All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dr. Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2] Makefile: adopt --std=gnu11 for HOSTCFLAGS on Linux
Date: Mon, 14 May 2018 17:02:43 +0200	[thread overview]
Message-ID: <2DBB680F-5DE2-4594-AC78-E1AE1B0D6AEE@theobroma-systems.com> (raw)
In-Reply-To: <245989a70d59d0ce@bloch.sibelius.xs4all.nl>


> On 14 May 2018, at 16:53, Mark Kettenis <mark.kettenis@xs4all.nl> wrote:
> 
>> From: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
>> Date: Mon, 14 May 2018 15:22:06 +0200
>> 
>> Following the conversion of the SPDX license tags, a number of files
>> compiled with -pedantic now generate warnings similar to the following
>> for using C99-style '//' comments in ISO C90 code:
>> 
>>  tools/gen_eth_addr.c:1:1: warning: C++ style comments are not allowed in ISO C90
>>   // SPDX-License-Identifier: GPL-2.0+
>>   ^
>> 
>> The SPDX comment-style change means that these files have adopted C99,
>> so need to change the language-standard to --std=gnu99 or --std=gnu11
>> to let the compiler know this.
>> 
>> As we now require GCC 6 or newer for the cross-compiler, the project has
>> implicitly moved the project to GNU11: let older GCC versions on various
>> Linux distros know to treat our host tools as GNU11 as well.
> 
> Note that the requirement is on the cross-compiler, not the host
> compiler.  On our "primary" architectures OpenBSD 6.3 ships with Clang
> 5.0.1 and the current development version uses Clang 6.0.0, which
> default to --std=gnu11.  I do hope those will continue to be supported
> as the host compiler…

Many of the files in question (e.g. lib/sha{1,256}.c) are shared between
the target and the host tools.

>> References: commit 83d290c56fab ("SPDX: Convert all of our single license tags to Linux Kernel style")
>> Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
>> ---
>> 
>> Changes in v2:
>> - Set '--std=gnu11' during compilation of host tools on Linux.
>> 
>> Makefile | 9 +++++++++
>> 1 file changed, 9 insertions(+)
>> 
>> diff --git a/Makefile b/Makefile
>> index f31ee60..d08fb6a 100644
>> --- a/Makefile
>> +++ b/Makefile
>> @@ -258,6 +258,15 @@ HOSTCFLAGS   = -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer \
>> 		$(if $(CONFIG_TOOLS_DEBUG),-g)
>> HOSTCXXFLAGS = -O2
>> 
>> +# With the move to GCC 6, we have implicitly upgraded our language
>> +# standard to GNU11 (see https://gcc.gnu.org/gcc-5/porting_to.html).
>> +# Some Linux distributions (including RHEL7, SLES13, Debian 8) still
>> +# have older compilers as their default, so we make it explicit for
>> +# these that our host tools are GNU11 (i.e. C11 w/ GNU extensions).
>> +ifeq ($(HOSTOS),linux)
>> +HOSTCFLAGS += --std=gnu11
>> +endif
>> +
>> ifeq ($(HOSTOS),cygwin)
>> HOSTCFLAGS	+= -ansi
>> endif
>> -- 
>> 2.1.4
>> 
>> _______________________________________________
>> U-Boot mailing list
>> U-Boot at lists.denx.de <mailto:U-Boot@lists.denx.de>
>> https://lists.denx.de/listinfo/u-boot <https://lists.denx.de/listinfo/u-boot>

  parent reply	other threads:[~2018-05-14 15:02 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-14 13:22 [U-Boot] [PATCH v2] Makefile: adopt --std=gnu11 for HOSTCFLAGS on Linux Philipp Tomsich
2018-05-14 14:47 ` Tom Rini
2018-05-14 14:53 ` Mark Kettenis
2018-05-14 14:57   ` Tom Rini
2018-05-14 20:58     ` Mark Kettenis
2018-05-14 21:48       ` Tom Rini
2018-05-14 15:02   ` Dr. Philipp Tomsich [this message]
2018-05-14 21:04     ` Mark Kettenis
2018-05-24 12:42 ` [U-Boot] [U-Boot, " 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=2DBB680F-5DE2-4594-AC78-E1AE1B0D6AEE@theobroma-systems.com \
    --to=philipp.tomsich@theobroma-systems.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.