[dpdk-dev] [PATCH] Minor C++11 compilation fix for rte_pci.h

Mcnamara, John john.mcnamara at intel.com
Fri Feb 13 11:27:33 CET 2015


> -----Original Message-----
> From: Richardson, Bruce
> Sent: Friday, February 13, 2015 10:18 AM
> To: Mcnamara, John
> Cc: Stefan Puiu; dev at dpdk.org
> Subject: Re: [dpdk-dev] [PATCH] Minor C++11 compilation fix for rte_pci.h
> 
> > >
> > > In C++11 concatenated string literals need to have a space in between.
> > > clang 3.4 reports this as an error (and IIRC also gcc-4.8):
> > >
> > > dpdk/include/rte_pci.h:96:26: error: invalid suffix on literal;
> > > C++11 requires a space between literal and identifier
> > > [-Wreserved-user-defined- literal]
> >
> >
> > That concatenated string literal with PRI* is used in 65 files in the
> DPDK source. Is that the only compilation error that you got?
> >
> > John
> 
> It should only be a problem in header files. The C files for DPDK source
> are always to be compiled up with a C compiler - only the headers get
> included in application C++ code.
> 

Hi,

In that case it only occurs in 3 header files. I guess that patch should be extended to include those as well:

    $ find lib  -name \*.h | xargs grep -l '"PRI'
    lib/librte_vhost/vhost-net-cdev.h
    lib/librte_eal/common/include/rte_pci.h
    lib/librte_mempool/rte_mempool.h

John.
-- 






More information about the dev mailing list