Skip to content

Commit ab0a40e

Browse files
Vasily Gorbikingomolnar
authored andcommitted
perf build: Allow nested externs to enable BUILD_BUG() usage
Currently the BUILD_BUG() macro is expanded to 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 would obviously produce build errors with -Wnested-externs and -Werror. To enable BUILD_BUG() usage in tools/arch/x86/lib/insn.c which perf includes in intel-pt-decoder, build perf without -Wnested-externs. Reported-by: Stephen Rothwell <sfr@canb.auug.org.au> Tested-by: Stephen Rothwell <sfr@canb.auug.org.au> # build tested Signed-off-by: Vasily Gorbik <gor@linux.ibm.com> Signed-off-by: Ingo Molnar <mingo@kernel.org> Link: https://lore.kernel.org/r/patch-1.thread-251403.git-2514037e9477.your-ad-here.call-01602244460-ext-7088@work.hours
1 parent 2486baa commit ab0a40e

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

tools/perf/Makefile.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ $(shell printf "" > $(OUTPUT).config-detected)
1616
detected = $(shell echo "$(1)=y" >> $(OUTPUT).config-detected)
1717
detected_var = $(shell echo "$(1)=$($(1))" >> $(OUTPUT).config-detected)
1818

19-
CFLAGS := $(EXTRA_CFLAGS) $(EXTRA_WARNINGS)
19+
CFLAGS := $(EXTRA_CFLAGS) $(filter-out -Wnested-externs,$(EXTRA_WARNINGS))
2020

2121
include $(srctree)/tools/scripts/Makefile.arch
2222

0 commit comments

Comments
 (0)