From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from keithw-W2600CR.windriver.com (97-94-195-106.dhcp.ftwo.tx.charter.com [97.94.195.106]) by dpdk.org (Postfix) with ESMTP id A7C8D959 for ; Sun, 5 Oct 2014 08:09:25 +0200 (CEST) Received: from keithw-W2600CR.windriver.com (localhost.localdomain [127.0.0.1]) by keithw-W2600CR.windriver.com (8.14.4/8.14.4/Debian-4.1ubuntu1) with ESMTP id s956GQ4l224881; Sun, 5 Oct 2014 01:16:26 -0500 Received: (from keithw@localhost) by keithw-W2600CR.windriver.com (8.14.4/8.14.4/Submit) id s956GQAs224880; Sun, 5 Oct 2014 01:16:26 -0500 From: Keith Wiles To: dev@dpdk.org Date: Sun, 5 Oct 2014 01:16:22 -0500 Message-Id: <1412489782-224822-1-git-send-email-keith.wiles@windriver.com> X-Mailer: git-send-email 2.1.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v4] 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: Sun, 05 Oct 2014 06:09:26 -0000 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. Rework to include Thomas’s suggestion to drop push/pop pragma directives for ignore/error directives. Signed-off-by: Keith Wiles --- lib/librte_mempool/rte_mempool.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/librte_mempool/rte_mempool.h b/lib/librte_mempool/rte_mempool.h index 95f19f9..163de86 100644 --- a/lib/librte_mempool/rte_mempool.h +++ b/lib/librte_mempool/rte_mempool.h @@ -313,7 +313,6 @@ static inline void __mempool_write_trailer_cookie(void *obj) */ #ifdef RTE_LIBRTE_MEMPOOL_DEBUG #ifndef __INTEL_COMPILER -#pragma GCC push_options #pragma GCC diagnostic ignored "-Wcast-qual" #endif static inline void __mempool_check_cookies(const struct rte_mempool *mp, @@ -380,7 +379,7 @@ static inline void __mempool_check_cookies(const struct rte_mempool *mp, } } #ifndef __INTEL_COMPILER -#pragma GCC pop_options +#pragma GCC diagnostic error "-Wcast-qual" #endif #else #define __mempool_check_cookies(mp, obj_table_const, n, free) do {} while(0) -- 2.1.0