From: Jiri Olsa Date: Thu, 29 Sep 2022 08:13:47 +0000 (+0200) Subject: perf parse-events: Ignore clang 15 warning about variable set but unused in bison... X-Git-Tag: baikal/mips/sdk6.1~4796^2~2 X-Git-Url: https://git.baikalelectronics.ru/sdk/?a=commitdiff_plain;h=eeb0d8c5b1347a1a4b7da94cb822850eb322d433;p=kernel.git perf parse-events: Ignore clang 15 warning about variable set but unused in bison produced code clang 15 now warns: 46 65.20 fedora:rawhide : FAIL clang version 15.0.0 (Fedora 15.0.0-3.fc38) util/parse-events-bison.c:1401:9: error: variable 'parse_events_nerrs' set but not used [-Werror,-Wunused-but-set-variable] int yynerrs = 0; ^ #define yynerrs parse_events_nerrs ^ 1 error generated. make[3]: *** [/git/perf-6.0.0-rc7/tools/build/Makefile.build:139: util] Error 2 Just ignore one more compiler warning for the bison generated C code. Committer notes: Older clangs don't know about -Wunused-but-set-variable, so we need to add -Wno-unknown-warning-option to avoid this: 37 44.92 fedora:32 : FAIL clang version 10.0.1 (Fedora 10.0.1-3.fc32) error: unknown warning option '-Wno-unused-but-set-variable'; did you mean '-Wno-unused-const-variable'? [-Werror,-Wunknown-warning-option] make[3]: *** [/git/perf-6.0.0-rc7/tools/build/Makefile.build:139: util] Error 2 Reported-by: Arnaldo Carvalho de Melo Signed-off-by: Jiri Olsa Tested-by: Arnaldo Carvalho de Melo Cc: Alexander Shishkin Cc: Ian Rogers Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Link: https://lore.kernel.org/lkml/20220929140514.226807-1-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- diff --git a/tools/perf/util/Build b/tools/perf/util/Build index 9dfae1bda9cc3..485e1a3431652 100644 --- a/tools/perf/util/Build +++ b/tools/perf/util/Build @@ -269,7 +269,7 @@ CFLAGS_expr-flex.o += $(flex_flags) bison_flags := -DYYENABLE_NLS=0 BISON_GE_35 := $(shell expr $(shell $(BISON) --version | grep bison | sed -e 's/.\+ \([0-9]\+\).\([0-9]\+\)/\1\2/g') \>\= 35) ifeq ($(BISON_GE_35),1) - bison_flags += -Wno-unused-parameter -Wno-nested-externs -Wno-implicit-function-declaration -Wno-switch-enum + bison_flags += -Wno-unused-parameter -Wno-nested-externs -Wno-implicit-function-declaration -Wno-switch-enum -Wno-unused-but-set-variable -Wno-unknown-warning-option else bison_flags += -w endif