From: Mark Kettenis Date: Mon, 14 May 2018 23:04:01 +0200 (CEST) Subject: [U-Boot] [PATCH v2] Makefile: adopt --std=gnu11 for HOSTCFLAGS on Linux In-Reply-To: <2DBB680F-5DE2-4594-AC78-E1AE1B0D6AEE@theobroma-systems.com> (philipp.tomsich@theobroma-systems.com) References: <1526304126-47200-1-git-send-email-philipp.tomsich@theobroma-systems.com> <245989a70d59d0ce@bloch.sibelius.xs4all.nl> <2DBB680F-5DE2-4594-AC78-E1AE1B0D6AEE@theobroma-systems.com> Message-ID: <24598ad43ad60ec1@bloch.sibelius.xs4all.nl> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: quoted-printable To: u-boot@lists.denx.de > From: "Dr. Philipp Tomsich" > Date: Mon, 14 May 2018 17:02:43 +0200 >=20 > > On 14 May 2018, at 16:53, Mark Kettenis wrote: > >=20 > >> From: Philipp Tomsich > >> Date: Mon, 14 May 2018 15:22:06 +0200 > >>=20 > >> 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: > >>=20 > >> tools/gen_eth_addr.c:1:1: warning: C++ style comments are not allowed= in ISO C90 > >> // SPDX-License-Identifier: GPL-2.0+ > >> ^ > >>=20 > >> The SPDX comment-style change means that these files have adopted C99, > >> so need to change the language-standard to --std=3Dgnu99 or --std=3Dgn= u11 > >> to let the compiler know this. > >>=20 > >> As we now require GCC 6 or newer for the cross-compiler, the project h= as > >> implicitly moved the project to GNU11: let older GCC versions on vario= us > >> Linux distros know to treat our host tools as GNU11 as well. > >=20 > > 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=3Dgnu11. I do hope those will continue to be supported > > as the host compiler=E2=80=A6 >=20 > Many of the files in question (e.g. lib/sha{1,256}.c) are shared between > the target and the host tools. Sure. But these files are all supposed to be fairly high-level code written in standard C. Ane decent C99 compiler shoul be able to compile that code. The specific GCC 6 requirement for the cross compiler was (mostly) introduced to be able to meet size constraints nad I don't think it makes sense to enforce it for the host compiler.