From mboxrd@z Thu Jan 1 00:00:00 1970 From: Pablo de Lara Subject: [PATCH] hash: fix compilation for gcc 4.4/4.5 Date: Wed, 15 Jul 2015 13:40:42 +0100 Message-ID: <1436964043-5729-2-git-send-email-pablo.de.lara.guarch@intel.com> References: <1436964043-5729-1-git-send-email-pablo.de.lara.guarch@intel.com> To: dev@dpdk.org Return-path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 805345947 for ; Wed, 15 Jul 2015 14:41:16 +0200 (CEST) Received: from sivswdev02.ir.intel.com (sivswdev02.ir.intel.com [10.237.217.46]) by irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id t6FCei1f012568 for ; Wed, 15 Jul 2015 13:40:44 +0100 Received: from sivswdev02.ir.intel.com (localhost [127.0.0.1]) by sivswdev02.ir.intel.com with ESMTP id t6FCehLU005775 for ; Wed, 15 Jul 2015 13:40:43 +0100 Received: (from pdelarax@localhost) by sivswdev02.ir.intel.com with id t6FCehfa005769 for dev@dpdk.org; Wed, 15 Jul 2015 13:40:43 +0100 In-Reply-To: <1436964043-5729-1-git-send-email-pablo.de.lara.guarch@intel.com> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" gcc 4.4 and 4.5 throws following error: rte_cuckoo_hash.c:145: error: flexible array member in otherwise empty struct. This is due to empty length in flexible array, which has been changed to use size 0 in the declaration of the array. Fixes: 48a399119619 ("hash: replace with cuckoo hash implementation") Reported-by: Olga Shern Signed-off-by: Pablo de Lara --- lib/librte_hash/rte_cuckoo_hash.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/librte_hash/rte_cuckoo_hash.c b/lib/librte_hash/rte_cuckoo_hash.c index 39cafb7..80cb126 100644 --- a/lib/librte_hash/rte_cuckoo_hash.c +++ b/lib/librte_hash/rte_cuckoo_hash.c @@ -142,7 +142,7 @@ struct rte_hash_key { void *pdata; }; /* Variable key size */ - char key[]; + char key[0]; } __attribute__((aligned(KEY_ALIGNMENT))); /** Bucket structure */ -- 2.4.2