Skip to contentSkip to conversation

x86/boot: Disable warnings about GNU extensions

PATCH New Matthias Kaehlcke 2 participants 2 messages Oct 30, 2017 – Oct 31, 2017 x86

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86/boot: Disable warnings about GNU extensions

The kernel makes use of several GCC extensions, disable clang warnings about that in the boot code, as we already do for the rest of the kernel.

This suppresses the following warning when building with clang:

./include/linux/cgroup-defs.h:391:16: warning: field 'cgrp' with variable sized type 'struct cgroup' not at the end of a struct or class is a GNU extension [-Wgnu-variable-sized-type-not-at-end]

        struct cgroup cgrp;
---
 arch/x86/boot/compressed/Makefile | 1 +
 1 file changed, 1 insertion(+)
arch/x86/boot/compressed/Makefile +1 -0
index 8a958274b54c..65a150a7f15c 100644
@@ -35,6 +35,7 @@ KBUILD_CFLAGS += -mno-mmx -mno-sse
 KBUILD_CFLAGS += $(call cc-option,-ffreestanding)
 KBUILD_CFLAGS += $(call cc-option,-fno-stack-protector)
 KBUILD_CFLAGS += $(call cc-disable-warning, address-of-packed-member)
+KBUILD_CFLAGS += $(call cc-disable-warning, gnu)
 
 KBUILD_AFLAGS  := $(KBUILD_CFLAGS) -D__ASSEMBLY__
 GCOV_PROFILE := n
Signature · 1 line
2.15.0.rc2.357.g7e34df9404-goog
#1 lore raw

[tip:x86/boot] x86/boot: Disable Clang warnings about GNU extensions

x86/boot: Disable Clang warnings about GNU extensions
Commit-ID:  6c3b56b1973083e2bb4e87eb90ea5368455706dc
Gitweb:     https://git.kernel.org/tip/6c3b56b1973083e2bb4e87eb90ea5368455706dc
Author:     Matthias Kaehlcke <[email protected]>
AuthorDate: Mon, 30 Oct 2017 12:43:51 -0700
Committer:  Ingo Molnar <[email protected]>
CommitDate: Tue, 31 Oct 2017 10:54:30 +0100

x86/boot: Disable Clang warnings about GNU extensions

The kernel makes use of several GCC extensions, disable Clang warnings about that in the boot code, as we already do for the rest of the kernel.

This suppresses the following warning when building with clang:

./include/linux/cgroup-defs.h:391:16: warning: field 'cgrp' with variable sized type 'struct cgroup' not at the end of a struct or class is a GNU extension [-Wgnu-variable-sized-type-not-at-end]

        struct cgroup cgrp;
---
 arch/x86/boot/compressed/Makefile | 1 +
 1 file changed, 1 insertion(+)
arch/x86/boot/compressed/Makefile +1 -0
index 8a95827..65a150a 100644
@@ -35,6 +35,7 @@ KBUILD_CFLAGS += -mno-mmx -mno-sse
 KBUILD_CFLAGS += $(call cc-option,-ffreestanding)
 KBUILD_CFLAGS += $(call cc-option,-fno-stack-protector)
 KBUILD_CFLAGS += $(call cc-disable-warning, address-of-packed-member)
+KBUILD_CFLAGS += $(call cc-disable-warning, gnu)
 
 KBUILD_AFLAGS  := $(KBUILD_CFLAGS) -D__ASSEMBLY__
 GCOV_PROFILE := n