From patchwork Fri May 11 02:00:45 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Green X-Patchwork-Id: 39810 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 0D4391C304; Fri, 11 May 2018 04:00:50 +0200 (CEST) Received: from mail.warmcat.com (mail.warmcat.com [163.172.24.82]) by dpdk.org (Postfix) with ESMTP id D43C91C186 for ; Fri, 11 May 2018 04:00:48 +0200 (CEST) From: Andy Green To: dev@dpdk.org Date: Fri, 11 May 2018 10:00:45 +0800 Message-ID: <152600404517.54839.9432753241220288463.stgit@localhost.localdomain> In-Reply-To: <152600382101.54839.18392182958431211001.stgit@localhost.localdomain> References: <152600382101.54839.18392182958431211001.stgit@localhost.localdomain> User-Agent: StGit/unknown-version Subject: [dpdk-dev] [PATCH v2 22/24] rte_hash_crc.h: stack vars declared at top of function X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" /projects/lagopus/src/dpdk/build/include/rte_hash_crc.h: In function 'crc32c_2words': /projects/lagopus/src/dpdk/build/include/rte_hash_crc.h:347:2: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement] uint32_t crc, term1, term2; Signed-off-by: Andy Green --- lib/librte_hash/rte_hash_crc.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/librte_hash/rte_hash_crc.h b/lib/librte_hash/rte_hash_crc.h index 479f84b14..5f5fb3db1 100644 --- a/lib/librte_hash/rte_hash_crc.h +++ b/lib/librte_hash/rte_hash_crc.h @@ -338,14 +338,13 @@ crc32c_1word(uint32_t data, uint32_t init_val) static inline uint32_t crc32c_2words(uint64_t data, uint32_t init_val) { + uint32_t crc, term1, term2; union { uint64_t u64; uint32_t u32[2]; } d; d.u64 = data; - uint32_t crc, term1, term2; - crc = init_val; crc ^= d.u32[0];