All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] tools/Makefile: build host tools with -std=gnu99
@ 2019-03-30 14:29 Thomas Petazzoni
  2019-03-30 14:39 ` Philipp Tomsich
  2019-04-03 17:23 ` [U-Boot] " Tom Rini
  0 siblings, 2 replies; 3+ messages in thread
From: Thomas Petazzoni @ 2019-03-30 14:29 UTC (permalink / raw)
  To: u-boot

Parts of the code are using C99 constructs (such as variables declared
inside loops), but also GNU extensions (such as typeof), so using
-std=gnu99 is necessary to build with older versions of gcc that don't
default to building with gnu99.

It fixes the following build failure:

./tools/../lib/crc16.c: In function "crc16_ccitt":
./tools/../lib/crc16.c:70:2: error: "for" loop initial declarations are only allowed in C99 mode
  for (int i = 0;  i < len;  i++)
  ^
./tools/../lib/crc16.c:70:2: note: use option -std=c99 or -std=gnu99 to compile your code

when building the host tools with gcc 4.7.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
---
 tools/Makefile | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tools/Makefile b/tools/Makefile
index 081383d7a7..d377d85f74 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -254,7 +254,8 @@ HOST_EXTRACFLAGS += -include $(srctree)/include/compiler.h \
 		-I$(srctree)/tools \
 		-DUSE_HOSTCC \
 		-D__KERNEL_STRICT_NAMES \
-		-D_GNU_SOURCE
+		-D_GNU_SOURCE \
+		-std=gnu99
 
 __build:	$(LOGO-y)
 
-- 
2.20.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [U-Boot] [PATCH] tools/Makefile: build host tools with -std=gnu99
  2019-03-30 14:29 [U-Boot] [PATCH] tools/Makefile: build host tools with -std=gnu99 Thomas Petazzoni
@ 2019-03-30 14:39 ` Philipp Tomsich
  2019-04-03 17:23 ` [U-Boot] " Tom Rini
  1 sibling, 0 replies; 3+ messages in thread
From: Philipp Tomsich @ 2019-03-30 14:39 UTC (permalink / raw)
  To: u-boot



> On 30.03.2019, at 15:29, Thomas Petazzoni <thomas.petazzoni@bootlin.com> wrote:
> 
> Parts of the code are using C99 constructs (such as variables declared
> inside loops), but also GNU extensions (such as typeof), so using
> -std=gnu99 is necessary to build with older versions of gcc that don't
> default to building with gnu99.
> 
> It fixes the following build failure:
> 
> ./tools/../lib/crc16.c: In function "crc16_ccitt":
> ./tools/../lib/crc16.c:70:2: error: "for" loop initial declarations are only allowed in C99 mode
>  for (int i = 0;  i < len;  i++)
>  ^
> ./tools/../lib/crc16.c:70:2: note: use option -std=c99 or -std=gnu99 to compile your code
> 
> when building the host tools with gcc 4.7.
> 
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>

Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [U-Boot] tools/Makefile: build host tools with -std=gnu99
  2019-03-30 14:29 [U-Boot] [PATCH] tools/Makefile: build host tools with -std=gnu99 Thomas Petazzoni
  2019-03-30 14:39 ` Philipp Tomsich
@ 2019-04-03 17:23 ` Tom Rini
  1 sibling, 0 replies; 3+ messages in thread
From: Tom Rini @ 2019-04-03 17:23 UTC (permalink / raw)
  To: u-boot

On Sat, Mar 30, 2019 at 03:29:23PM +0100, Thomas Petazzoni wrote:

> Parts of the code are using C99 constructs (such as variables declared
> inside loops), but also GNU extensions (such as typeof), so using
> -std=gnu99 is necessary to build with older versions of gcc that don't
> default to building with gnu99.
> 
> It fixes the following build failure:
> 
> ./tools/../lib/crc16.c: In function "crc16_ccitt":
> ./tools/../lib/crc16.c:70:2: error: "for" loop initial declarations are only allowed in C99 mode
>   for (int i = 0;  i < len;  i++)
>   ^
> ./tools/../lib/crc16.c:70:2: note: use option -std=c99 or -std=gnu99 to compile your code
> 
> when building the host tools with gcc 4.7.
> 
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
> Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>

Applied to u-boot/master, thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20190403/fc711ee2/attachment.sig>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-04-03 17:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-30 14:29 [U-Boot] [PATCH] tools/Makefile: build host tools with -std=gnu99 Thomas Petazzoni
2019-03-30 14:39 ` Philipp Tomsich
2019-04-03 17:23 ` [U-Boot] " Tom Rini

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.