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 3FB3C212 for ; Wed, 1 Oct 2014 18:59:21 +0200 (CEST) Received: from ALA-HCA.corp.ad.wrs.com (ala-hca.corp.ad.wrs.com [147.11.189.40]) by mail.windriver.com (8.14.9/8.14.5) with ESMTP id s91H64mU024078 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=FAIL); Wed, 1 Oct 2014 10:06:05 -0700 (PDT) Received: from ALA-MBB.corp.ad.wrs.com ([169.254.1.18]) by ALA-HCA.corp.ad.wrs.com ([147.11.189.40]) with mapi id 14.03.0174.001; Wed, 1 Oct 2014 10:06:04 -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+2lngZxJZwbymAAgAAj/wA= Date: Wed, 1 Oct 2014 17:06:03 +0000 Message-ID: <75C71BEC-BEF6-4318-893C-5E8BF307EB79@windriver.com> References: <41114A6E-08AB-4269-9E4F-9930BD04D8E2@windriver.com> <3EC8A7DC-C947-40DC-B8FD-60023A12B00A@windriver.com> <1602501.e1dujvioa1@xps13> <0D8AEEBE-82D7-4DD4-9FF3-E86DF6C144B8@windriver.com> In-Reply-To: <0D8AEEBE-82D7-4DD4-9FF3-E86DF6C144B8@windriver.com> 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: <0C174887CB55154C9903AE151B2F02B9@local> 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 16:59:21 -0000 Thomas, I will submit a v3 patch in a few minutes. On Oct 1, 2014, at 9:57 AM, Wiles, Roger Keith = wrote: > Hi Thomas, >=20 > Changing the macros to: >=20 > #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 >=20 > Works and is a good solution. I normally do not like negative =91ifndef= =92 but it works :-) >=20 > Can you make that change if everyone agrees, as would have to remove othe= r changes to that file I want to do in the future to resend this patch. If = not I can try and figure it out :-) >=20 > Thanks > ++Keith >=20 > On Oct 1, 2014, at 7:58 AM, Thomas Monjalon w= rote: >=20 >> 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 >=20 > Keith Wiles, Principal Technologist with CTO office, Wind River mobile 97= 2-213-5533 >=20 Keith Wiles, Principal Technologist with CTO office, Wind River mobile 972-= 213-5533