From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.windriver.com (mail.windriver.com [147.11.1.11]) by dpdk.org (Postfix) with ESMTP id 28BC76A99 for ; Wed, 1 Oct 2014 16:50:30 +0200 (CEST) Received: from ALA-HCB.corp.ad.wrs.com (ala-hcb.corp.ad.wrs.com [147.11.189.41]) by mail.windriver.com (8.14.9/8.14.5) with ESMTP id s91EvC2R025274 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=FAIL); Wed, 1 Oct 2014 07:57:13 -0700 (PDT) Received: from ALA-MBB.corp.ad.wrs.com ([169.254.1.18]) by ALA-HCB.corp.ad.wrs.com ([147.11.189.41]) with mapi id 14.03.0174.001; Wed, 1 Oct 2014 07:57:12 -0700 From: "Wiles, Roger Keith" To: Thomas Monjalon Thread-Topic: [dpdk-dev] [PATCH v2] Clang compile error with RTE_LIBRTE_MEMPOOL_DEBUG enabled. Thread-Index: AQHP3Xdk8j54h3AjOUml6+2lngZxJZwbymAA Date: Wed, 1 Oct 2014 14:57:12 +0000 Message-ID: <0D8AEEBE-82D7-4DD4-9FF3-E86DF6C144B8@windriver.com> References: <41114A6E-08AB-4269-9E4F-9930BD04D8E2@windriver.com> <3EC8A7DC-C947-40DC-B8FD-60023A12B00A@windriver.com> <1602501.e1dujvioa1@xps13> In-Reply-To: <1602501.e1dujvioa1@xps13> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [172.25.40.166] Content-Type: text/plain; charset="Windows-1252" Content-ID: Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Cc: "dev@dpdk.org" Subject: Re: [dpdk-dev] [PATCH v2] Clang compile error with RTE_LIBRTE_MEMPOOL_DEBUG enabled. 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: Wed, 01 Oct 2014 14:50:30 -0000 Hi Thomas, Changing the macros to: #ifdef RTE_LIBRTE_MEMPOOL_DEBUG #ifndef __INTEL_COMPILER #pragma GCC diagnostic ignored "-Wcast-qual" #endif . . #ifndef __INTEL_COMPILER #pragma GCC diagnostic error "-Wcast-qual" #endif Works and is a good solution. I normally do not like negative =91ifndef=92 = but it works :-) Can you make that change if everyone agrees, as would have to remove other = changes to that file I want to do in the future to resend this patch. If no= t I can try and figure it out :-) Thanks ++Keith On Oct 1, 2014, at 7:58 AM, Thomas Monjalon wro= te: > 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. >>=20 >> GCC 4.4 is when push_options and pop_options pragma show up. >>=20 >> Signed-off-by: Keith Wiles > [...] >> -#ifndef __INTEL_COMPILER >> +#if (__GNUC__ > 4) || ((__GNUC__ =3D=3D 4) && (__GNUC_MINOR__ >=3D 4)) >> #pragma GCC push_options >> #pragma GCC diagnostic ignored "-Wcast-qual" >> #endif >=20 > Does clang accept const casting with -Wcast-qual? >=20 > 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 >=20 > --=20 > Thomas Keith Wiles, Principal Technologist with CTO office, Wind River mobile 972-= 213-5533