From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH v2] Clang compile error with RTE_LIBRTE_MEMPOOL_DEBUG enabled. Date: Wed, 01 Oct 2014 14:58:05 +0200 Message-ID: <1602501.e1dujvioa1@xps13> References: <41114A6E-08AB-4269-9E4F-9930BD04D8E2@windriver.com> <3EC8A7DC-C947-40DC-B8FD-60023A12B00A@windriver.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: dev-VfR2kkLFssw@public.gmane.org To: "Wiles, Roger Keith" Return-path: In-Reply-To: <3EC8A7DC-C947-40DC-B8FD-60023A12B00A-CWA4WttNNZF54TAoqtyWWQ@public.gmane.org> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces-VfR2kkLFssw@public.gmane.org Sender: "dev" 2014-09-28 05:30, Wiles, Roger Keith: > When enabling RTE_LIBRTE_MEMPOOL_DEBUG and compiling with clang > compiler an error occurs, because ifdefed code now includes GCC pragmas. > > GCC 4.4 is when push_options and pop_options pragma show up. > > Signed-off-by: Keith Wiles [...] > -#ifndef __INTEL_COMPILER > +#if (__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) > #pragma GCC push_options > #pragma GCC diagnostic ignored "-Wcast-qual" > #endif Does clang accept const casting with -Wcast-qual? I'd prefer to use the same logic as in rte_mempool.c: #pragma GCC diagnostic ignored "-Wcast-qual" #pragma GCC diagnostic error "-Wcast-qual" without using push/pop. Or if push/pop is really needed, it is implemented in clang: http://clang.llvm.org/docs/UsersManual.html#controlling-diagnostics-via-pragmas -- Thomas