DPDK patches and discussions
 help / color / mirror / Atom feed
From: Thomas Monjalon <thomas@monjalon.net>
To: Stephen Hemminger <stephen@networkplumber.org>
Cc: "Patil, Harish" <Harish.Patil@cavium.com>,
	"liang.j.ma@intel.com" <liang.j.ma@intel.com>,
	"peter.mccarthy@intel.com" <peter.mccarthy@intel.com>,
	jerin.jacob@caviumnetworks.com, dev@dpdk.org,
	ferruh.yigit@intel.com, adrien.mazarguil@6wind.com
Subject: Re: [dpdk-dev] Compilation errors in drivers/event/opdl/
Date: Sun, 21 Jan 2018 18:49:13 +0100	[thread overview]
Message-ID: <5211400.X7DXXCoju3@xps> (raw)
In-Reply-To: <20180121093458.082f4589@xeon-e3>

21/01/2018 18:34, Stephen Hemminger:
> On Sat, 20 Jan 2018 09:44:46 +0100
> Thomas Monjalon <thomas@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)?

  reply	other threads:[~2018-01-21 17:49 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-20  5:18 Patil, Harish
2018-01-20  8:44 ` Thomas Monjalon
2018-01-21 17:34   ` Stephen Hemminger
2018-01-21 17:49     ` Thomas Monjalon [this message]
2018-01-26 17:39       ` Adrien Mazarguil
2018-01-20  8:56 ` Jerin Jacob
2018-01-22 18:38   ` Patil, Harish

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5211400.X7DXXCoju3@xps \
    --to=thomas@monjalon.net \
    --cc=Harish.Patil@cavium.com \
    --cc=adrien.mazarguil@6wind.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=jerin.jacob@caviumnetworks.com \
    --cc=liang.j.ma@intel.com \
    --cc=peter.mccarthy@intel.com \
    --cc=stephen@networkplumber.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).