Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Romain Naour <romain.naour@gmail.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH] package/expedite: fix build issue with C89
Date: Sat, 29 Apr 2017 12:41:24 +0200	[thread overview]
Message-ID: <5b4e38bc-bbac-8699-9c1f-4bb8eb32ae88@gmail.com> (raw)
In-Reply-To: <20170422144236.49b73b04@free-electrons.com>

Hi Thomas,

Le 22/04/2017 ? 14:42, Thomas Petazzoni a ?crit :
> Hello,
> 
> On Fri, 21 Apr 2017 23:31:04 +0200, Romain Naour wrote:
> 
>> +# The code use for loop initial declarations which are only allowed in
>> +# C99 mode. Use the default compiler version (gnu99) used by gcc 5+ to
>> +# workaround some build issues with C99.
>> +EXPEDITE_CONF_ENV += CFLAGS="$(TARGET_CFLAGS) -std=gnu99"
> 
> What is the full command line used by expedite to build its C files?
> Gcc 5.x uses -std=c11 by default, and C11 apparently accepts definition
> of variables inside the initialization part of for() loops. So it seems
> like expedite is overriding the default -std= GCC option with its
> own...
> 
> Or maybe it's the configure.ac AC_PROG_CC that does this by default?
> Anyway, it's worth checking and doing something upstreamable rather
> than working around in the .mk file.

The build system doesn't override the default C language version, it just use
the one used by default by the compiler.
The definition of variables inside the initialization part of for() loops was
added by the latest commit without adding c99 or gnu99 in the cflags.

I used a gcc5 based toolchain while I tested this version of expedite, that's
why I didn't had any issue.

Another easy solution is to not use definition of variables inside the
initialization part of for() loops.

Best regards,
Romain

> 
> Best regards,
> 
> Thomas
> 

      reply	other threads:[~2017-04-29 10:41 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-21 21:31 [Buildroot] [PATCH] package/expedite: fix build issue with C89 Romain Naour
2017-04-22 12:42 ` Thomas Petazzoni
2017-04-29 10:41   ` Romain Naour [this message]

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=5b4e38bc-bbac-8699-9c1f-4bb8eb32ae88@gmail.com \
    --to=romain.naour@gmail.com \
    --cc=buildroot@busybox.net \
    /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