From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wi0-f172.google.com (mail-wi0-f172.google.com [209.85.212.172]) by dpdk.org (Postfix) with ESMTP id 71BF9C49C for ; Mon, 29 Jun 2015 11:35:11 +0200 (CEST) Received: by wicnd19 with SMTP id nd19so65759760wic.1 for ; Mon, 29 Jun 2015 02:35:11 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=7Nq3McjXBaT5AyuClfiqrQMjujgnVOucLl9+GevnC2I=; b=Gnyd93CqQ1wLBkzZQQSPyuId70JV0CpyDo93HP9zP7hWukbmhCZQ7uoHG8c8Xcayju h6PxsWZl/om5pm39yvSeatWVhEy6ga+VsexubCMzk0BMaT+NcifW4z86OOQ/QlinVm67 e8TOuwZFwzumV1fcGxy8DH7qhUaPsnr/bwhwyjZt3AP9l/KpnPUqagLSgSum9fW4cN4x kO/6ujpJNaU7x9XaCNWIyT5RanLZOOmRJwgy7IvWiKpzCeZyp/yyntYCDm3R6NwG8KQC cDxwwumbNz9vhV7laXW7yAq4/w4Xly9+nCxD2IUi/iynVyUyL7El2aGYfuFutIxoHZp4 vi/w== X-Gm-Message-State: ALoCoQlgD5D+FIQjtXYIo+pBGY50Il9M9WSGhDg9RrxnMSnzCthshQ9tHvEpv6qtXGlveYV+eL44 X-Received: by 10.180.9.111 with SMTP id y15mr20033939wia.18.1435570511336; Mon, 29 Jun 2015 02:35:11 -0700 (PDT) Received: from 6wind.com (6wind.net2.nerim.net. [213.41.151.210]) by mx.google.com with ESMTPSA id f8sm11228648wiy.7.2015.06.29.02.35.09 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 29 Jun 2015 02:35:10 -0700 (PDT) From: Adrien Mazarguil To: Thomas Monjalon Date: Mon, 29 Jun 2015 11:34:52 +0200 Message-Id: <1435570492-19291-1-git-send-email-adrien.mazarguil@6wind.com> X-Mailer: git-send-email 2.1.0 In-Reply-To: <6446943.entjzpE8eR@xps13> References: <6446943.entjzpE8eR@xps13> Cc: dev@dpdk.org Subject: [dpdk-dev] [PATCH] eal: fix cpu_feature_table[] compilation with -pedantic X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Jun 2015 09:35:11 -0000 Since the commit below includes rte_cpuflags.h in rte_spinlock.h, compilation of the mlx4 driver fails when CONFIG_RTE_LIBRTE_MLX4_DEBUG=y. This mode adds -pedantic to the compiler's command line for mlx4, which complains about the static definition of an empty cpu_feature_table[] in common rte_cpuflags.h, then about its redefinition as a larger array in arch-specific rte_cpuflags.h. While DPDK does not officially support -pedantic internally, external applications may enable it and include rte_spinlock.h from the public API. Instead of removing -pedantic from mlx4, this commit fixes rte_cpuflags.h. Fixes: ba7468997ea6 ("spinlock: add HTM lock elision for x86") Signed-off-by: Adrien Mazarguil --- lib/librte_eal/common/include/generic/rte_cpuflags.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/librte_eal/common/include/generic/rte_cpuflags.h b/lib/librte_eal/common/include/generic/rte_cpuflags.h index a04e021..61c4db1 100644 --- a/lib/librte_eal/common/include/generic/rte_cpuflags.h +++ b/lib/librte_eal/common/include/generic/rte_cpuflags.h @@ -74,8 +74,12 @@ struct feature_entry { /** * An array that holds feature entries + * + * Defined in arch-specific rte_cpuflags.h. */ +#ifdef __DOXYGEN__ static const struct feature_entry cpu_feature_table[]; +#endif /** * Execute CPUID instruction and get contents of a specific register -- 2.1.0