[dpdk-stable] [dpdk-dev] [PATCH v2] ethdev: missing typecast causes C++ build error

Ananyev, Konstantin konstantin.ananyev at intel.com
Tue Apr 16 18:46:14 CEST 2019



> -----Original Message-----
> From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Andrew Rybchenko
> Sent: Tuesday, April 16, 2019 5:40 PM
> To: Yigit, Ferruh <ferruh.yigit at intel.com>; David Christensen <drc at linux.vnet.ibm.com>; thomas at monjalon.net
> Cc: dev at dpdk.org; radhika.chirra at ibm.com; stable at dpdk.org
> Subject: Re: [dpdk-dev] [dpdk-stable] [PATCH v2] ethdev: missing typecast causes C++ build error
> 
> On 4/16/19 7:31 PM, Ferruh Yigit wrote:
> > On 4/10/2019 10:36 PM, David Christensen wrote:
> >> The function eth_dev_pci_specific_init is missing a typecast to
> >> (struct rte_pci_device *) for the input argument bus_device.
> >> This causes build issues in the GNU C++ compiler.
> >>
> >> [CXX]       g++ -o utils/pcap_handle.o -c utils/pcap_handle.cc -g3·
> >> -ggdb3 -mcpu=native -mtune=native -isystem·
> >> /home/rchirra/gen/io/ppc64include -std=gnu++11 -flax-vector-conversions·
> >> -Werror -isystem /home/rchirra/gen/io
> >>
> >> In file included from drivers/pmd.cc:7:0:
> >> /home/rchirra/gen/io/deps/dpdk/build/include/rte_ethdev_pci.h:
> >> In function ‘int eth_dev_pci_specific_init(rte_eth_dev*, void*)’:
> >> /home/rchirra/gen/io/deps/dpdk/build/include/rte_ethdev_pci.h:75:35:·
> >> error: invalid conversion from ‘void*’ to ‘rte_pci_device*’
> >> [-fpermissive]
> >>    struct rte_pci_device *pci_dev = bus_device;
> >>                                     ^~~~~~~~~~
> >> make[1]: *** [drivers/pmd.o] Error 1
> >>
> >> $ g++ --version
> >> g++ (Ubuntu 7.3.0-27ubuntu1~18.04) 7.3.0
> > This problem is while building a driver with c++ compiler, but since the
> > solution is a simple casting, which doesn't have any side affect, I am for
> > getting the patch, any objection?
> 
> It should be a decision that we support PMDs in C++ (if I understand
> the usage correctly) and it will require all headers to be compatible and
> ideally it should be checked by build automation (otherwise we will break
> and fix it pretty often).

Or as alternative, we probably can claim that PMDs in C++ are not supported,
and if people like to do that - they have to deal with it on their own
(create a C wrapper file, or so).
Konstantin



More information about the stable mailing list