All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCHv2] tools: Stop re-defining -std= when building tools
@ 2021-10-11 15:11 Tom Rini
  2021-10-20  0:46 ` Tom Rini
  0 siblings, 1 reply; 2+ messages in thread
From: Tom Rini @ 2021-10-11 15:11 UTC (permalink / raw)
  To: u-boot

While we intentionally set -std=gnu11 for building host tools, and have
for quite some time, we never dropped -std=gnu99 from tools/Makefile.
This resulted in passing -std=gnu11 ... -std=gnu99 when building, and
gnu99 would win.  This in turn would result now in warnings such as:
tools/mkeficapsule.c:25:15: warning: redefinition of typedef 'u32' is a C11 feature [-Wtypedef-redefinition]
typedef __u32 u32;
              ^

Signed-off-by: Tom Rini <trini@konsulko.com>
---
Changes in v2:
- Always use -std=gnu11 after Bin pointed out that we have only been
  enforcing this for Linux hosts.
---
 Makefile       | 2 --
 tools/Makefile | 3 +--
 2 files changed, 1 insertion(+), 4 deletions(-)

diff --git a/Makefile b/Makefile
index f911f7034430..723f80e34459 100644
--- a/Makefile
+++ b/Makefile
@@ -299,9 +299,7 @@ KBUILD_HOSTLDLIBS   := $(HOST_LFS_LIBS) $(HOSTLDLIBS)
 # 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).
 CSTD_FLAG := -std=gnu11
-ifeq ($(HOSTOS),linux)
 KBUILD_HOSTCFLAGS += $(CSTD_FLAG)
-endif
 
 ifeq ($(HOSTOS),cygwin)
 KBUILD_HOSTCFLAGS	+= -ansi
diff --git a/tools/Makefile b/tools/Makefile
index 999fd4653166..b45219e2c30c 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -295,8 +295,7 @@ HOST_EXTRACFLAGS += -include $(srctree)/include/compiler.h \
 		-I$(srctree)/tools \
 		-DUSE_HOSTCC \
 		-D__KERNEL_STRICT_NAMES \
-		-D_GNU_SOURCE \
-		-std=gnu99
+		-D_GNU_SOURCE
 
 __build:	$(LOGO-y)
 
-- 
2.25.1


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

* Re: [PATCHv2] tools: Stop re-defining -std= when building tools
  2021-10-11 15:11 [PATCHv2] tools: Stop re-defining -std= when building tools Tom Rini
@ 2021-10-20  0:46 ` Tom Rini
  0 siblings, 0 replies; 2+ messages in thread
From: Tom Rini @ 2021-10-20  0:46 UTC (permalink / raw)
  To: u-boot

[-- Attachment #1: Type: text/plain, Size: 608 bytes --]

On Mon, Oct 11, 2021 at 11:11:41AM -0400, Tom Rini wrote:

> While we intentionally set -std=gnu11 for building host tools, and have
> for quite some time, we never dropped -std=gnu99 from tools/Makefile.
> This resulted in passing -std=gnu11 ... -std=gnu99 when building, and
> gnu99 would win.  This in turn would result now in warnings such as:
> tools/mkeficapsule.c:25:15: warning: redefinition of typedef 'u32' is a C11 feature [-Wtypedef-redefinition]
> typedef __u32 u32;
>               ^
> 
> Signed-off-by: Tom Rini <trini@konsulko.com>

Applied to u-boot/master, thanks!

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

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

end of thread, other threads:[~2021-10-20  0:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-11 15:11 [PATCHv2] tools: Stop re-defining -std= when building tools Tom Rini
2021-10-20  0:46 ` 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.