Skip to content

Commit 2486baa

Browse files
Vasily Gorbikjpoimboe
authored andcommitted
objtool: Allow nested externs to enable BUILD_BUG()
Currently BUILD_BUG() macro is expanded to smth like the following: do { extern void __compiletime_assert_0(void) __attribute__((error("BUILD_BUG failed"))); if (!(!(1))) __compiletime_assert_0(); } while (0); If used in a function body this obviously would produce build errors with -Wnested-externs and -Werror. Build objtool with -Wno-nested-externs to enable BUILD_BUG() usage. Signed-off-by: Vasily Gorbik <gor@linux.ibm.com> Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
1 parent b0b8e56 commit 2486baa

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

tools/objtool/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ INCLUDES := -I$(srctree)/tools/include \
3737
-I$(srctree)/tools/arch/$(HOSTARCH)/include/uapi \
3838
-I$(srctree)/tools/arch/$(SRCARCH)/include \
3939
-I$(srctree)/tools/objtool/arch/$(SRCARCH)/include
40-
WARNINGS := $(EXTRA_WARNINGS) -Wno-switch-default -Wno-switch-enum -Wno-packed
40+
WARNINGS := $(EXTRA_WARNINGS) -Wno-switch-default -Wno-switch-enum -Wno-packed -Wno-nested-externs
4141
CFLAGS := -Werror $(WARNINGS) $(KBUILD_HOSTCFLAGS) -g $(INCLUDES) $(LIBELF_FLAGS)
4242
LDFLAGS += $(LIBELF_LIBS) $(LIBSUBCMD) $(KBUILD_HOSTLDFLAGS)
4343

0 commit comments

Comments
 (0)