[dpdk-dev] [PATCH] test: Disable strict-aliasing warnings

De Lara Guarch, Pablo pablo.de.lara.guarch at intel.com
Fri Mar 27 10:29:01 CET 2015



> -----Original Message-----
> From: Thomas Monjalon [mailto:thomas.monjalon at 6wind.com]
> Sent: Friday, March 27, 2015 9:20 AM
> To: De Lara Guarch, Pablo
> Cc: dev at dpdk.org
> Subject: Re: [dpdk-dev] [PATCH] test: Disable strict-aliasing warnings
> 
> 2015-03-26 19:17, Pablo de Lara:
> > DPDK does not build on gcc 4.4, as it complains due to
> > strict-aliasing rules in virtual_pmd and link_bonding_mode4 tests,
> > with no errors in next gcc versions:
> 
> Do you mean it's not possible to fix it in the code?
> You are disabling some checks which may be relevant.

I mean it is possible to fix, but probably not worth it, considering that
newer gcc versions have no issues (and gcc 4.4 is from 2011).
I have seen that there are other libraries that disable these warnings as well,
so I assumed we could do the same here.

Pablo
> 
> > CC virtual_pmd.o
> > CC test_link_bonding_mode4.o
> > cc1: warnings being treated as errors
> > /root/dpdk/app/test/test_link_bonding_mode4.c: In function
> ‘test_mode4_expired’:
> > /root/dpdk/x86_64-native-linuxapp-gcc/include/rte_ring.h:645: error:
> dereferencing pointer ‘pkt.409’ does break strict-aliasing rules
> > /root/dpdk/x86_64-native-linuxapp-gcc/include/rte_ring.h:729: error:
> dereferencing pointer ‘pkt.409’ does break strict-aliasing rules
> > ...
> > cc1: warnings being treated as errors
> > /root/dpdk/app/test/virtual_pmd.c: In function
> ‘virtual_ethdev_stats_reset’:
> > /root/dpdk/x86_64-native-linuxapp-gcc/include/rte_ring.h:645: error:
> dereferencing pointer ‘pkt.338’ does break strict-aliasing rules
> > /root/dpdk/x86_64-native-linuxapp-gcc/include/rte_ring.h:729: error:
> dereferencing pointer ‘pkt.338’ does break strict-aliasing rules
> >
> > This patch fixes the compilation by disabling
> > these warnings.
> >
> > Signed-off-by: Pablo de Lara <pablo.de.lara.guarch at intel.com>
> > ---
> >  app/test/Makefile |    5 +++++
> >  1 files changed, 5 insertions(+), 0 deletions(-)
> >
> > diff --git a/app/test/Makefile b/app/test/Makefile
> > index 4aca77c..0d62d07 100644
> > --- a/app/test/Makefile
> > +++ b/app/test/Makefile
> > @@ -158,6 +158,11 @@ CFLAGS_test_memcpy_perf.o += -fno-var-
> tracking-assignments
> >  endif
> >  endif
> >
> > +# Disable warnings of no-strict-aliasing in virtual_pmd
> > +# and test_link_bonding_mode4 tests
> > +CFLAGS_virtual_pmd.o += -Wno-strict-aliasing
> > +CFLAGS_test_link_bonding_mode4.o += -Wno-strict-aliasing
> > +
> >  # this application needs libraries first
> >  DEPDIRS-y += lib
> >
> >
> 



More information about the dev mailing list