From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Hemminger Subject: [PATCH 4/6] mempool: use GCC push/pop Date: Fri, 07 Mar 2014 10:13:39 -0800 Message-ID: <20140307181427.254643901@vyatta.com> References: <20140307181335.024904493@vyatta.com> Cc: dev-VfR2kkLFssw@public.gmane.org, Stephen Hemminger To: "Venkatesan, Venky" Return-path: Content-Disposition: inline; filename=mempool-opts.patch 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" The include file should not change the GCC compile options for the whole file being compiled, but only for the one inline function that needs it. Using the push_options/pop_options fixes this. Signed-off-by: Stephen Hemminger --- a/lib/librte_mempool/rte_mempool.h 2014-01-23 09:15:55.000000000 -0800 +++ b/lib/librte_mempool/rte_mempool.h 2014-03-06 15:19:56.551238180 -0800 @@ -314,6 +314,7 @@ static inline void __mempool_write_trail */ #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 +381,7 @@ static inline void __mempool_check_cooki } } #ifndef __INTEL_COMPILER -#pragma GCC diagnostic error "-Wcast-qual" +#pragma GCC pop_options #endif #else #define __mempool_check_cookies(mp, obj_table_const, n, free) do {} while(0)