
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