[dpdk-dev] Compilation errors in drivers/event/opdl/
Thomas Monjalon
thomas at monjalon.net
Sun Jan 21 18:49:13 CET 2018
21/01/2018 18:34, Stephen Hemminger:
> On Sat, 20 Jan 2018 09:44:46 +0100
> Thomas Monjalon <thomas at monjalon.net> wrote:
>
> > 20/01/2018 06:18, Patil, Harish:
> > > Hi,
> > >
> > > I am seeing below compilation errors in drivers/event/opdl/, this is with
> > > cloned latest DPDK (git clone http://dpdk.org/git/dpdk).
> > >
> > > ..
> > > ..
> > > /home2/hpatil/e4/jan19-inbox-submit/dpdk/drivers/event/opdl/opdl_evdev_xsta
> > > ts.c: In function ‘opdl_xstats_get_names’:
> > > /home2/hpatil/e4/jan19-inbox-submit/dpdk/drivers/event/opdl/opdl_evdev_xsta
> > > ts.c:89:2: error: ‘for’ loop initial declarations are only allowed in
> > > C99 mode
> > > for (uint32_t j = 0; j < max_num_port_xstat; j++) {
> > > ^
> >
> > My compiler does not raise this error.
> > What is your compiler?
> >
> > Anyone to fix it QUICKLY please? today?
> >
> > Harish, do you think we should revert if not fixed?
>
> Using declaration in for loop is a C++ thing which was inherited into C99.
> Does DPDK require C99 mode?
No DPDK is not generally C99.
> Putting loop variables in for() looks better, but the rest of DPDK
> doesn't use that style.
C99 was forced for this driver as a quick fix.
Either the coding style guideline is updated to C99,
or this driver must be adapted to the DPDK coding style.
I have no strong opinion.
Is C99 well supported in all compilers we want to use (including Windows)?
More information about the dev
mailing list