public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] lib/crc16: use non-C99 loop style
Date: Thu, 14 Feb 2019 08:56:15 +0100	[thread overview]
Message-ID: <20190214085615.3bbcbd47@windsurf> (raw)
In-Reply-To: <9A6E6FE9-1037-4D47-BB1C-21D775A8557C@theobroma-systems.com>

Hello,

On Thu, 14 Feb 2019 01:57:02 +0100
Philipp Tomsich <philipp.tomsich@theobroma-systems.com> wrote:


> At the moment, our code requires at least GNU89 (i.e. not C89) or C99, even
> when compiling our host tools (which shouldn’t require any GNU extensions,
> as we shouldn’t need inline-asm in the host tools).
> So the earliest ISO standard language dialect we can hope to comply with is 
> ISO/IEC 9899:1999 (i.e. C99).
> 
> I’ve never been a big fan of requiring GNU89 (i.e. GCC) just to get some of 
> the C99 features we need (e.g. offsetof, const, …) when the source can simply
> be declared to be C99.
> 
> So shouldn’t we just add a “-std=c99” to HOST_EXTRACFLAGS?

Adding -std=c99 to the CFLAGS used when building host tools would
indeed be another solution, which would work equally well for me.

However, generally speaking is U-Boot interested in allowing this kind
of C99 variable declaration ? For example, the Linux kernel coding
style doesn't allow this, but perhaps U-Boot has made a difference
choice here.

I don't have any strong opinion about this: we just bumped to U-Boot
2019.01 in Buildroot, and one of our autobuilders that intentionally
uses a very old Debian system encountered this build failure. Buildroot
is used in lots of "enterprise" contexts, where enterprise often means
"the IT forces the poor developers to use antique Linux systems for
their job", and we're trying to make the life of those poor developers
slightly easier :-)

Best regards,

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

  reply	other threads:[~2019-02-14  7:56 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-13 21:57 [U-Boot] [PATCH] lib/crc16: use non-C99 loop style Thomas Petazzoni
2019-02-13 22:50 ` Philipp Tomsich
2019-02-14  0:31 ` Tom Rini
2019-02-14  0:57   ` Philipp Tomsich
2019-02-14  7:56     ` Thomas Petazzoni [this message]
2019-02-14 11:35       ` Philipp Tomsich
2019-02-14 12:22         ` Tom Rini

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=20190214085615.3bbcbd47@windsurf \
    --to=thomas.petazzoni@bootlin.com \
    --cc=u-boot@lists.denx.de \
    /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