Skip to contentSkip to conversation

perf: turn off compiler warnings for flex and bison generated files

PATCH In review Greg Kroah-Hartman 1 participant 2 messages May 4, 2012 – May 7, 2012 perf events

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 perf: turn off compiler warnings for flex and bison generated files

We don't know what types of warnings different versions of flex and bison combined with different versions of gcc is going to generate, so just punt and don't warn about anything.

This fixes the build of perf for me on an openSUSE 12.1 system.

Cc Peter Zijlstra <[email protected]>
Cc Paul Mackerras <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc Arnaldo Carvalho de Melo <[email protected]>

---
Note, I don't really like this, but how else are we going to ensure that we catch all warnings? Pick them off one by one? Better ideas are accepted, but something needs to be done soon, you don't want this broken for 3.4.

 tools/perf/Makefile |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
tools/perf/Makefile +2 -2
index 9bf3fc7..92271d3 100644
@@ -774,10 +774,10 @@ $(OUTPUT)perf.o perf.spec \
 # over the general rule for .o
 
 $(OUTPUT)util/%-flex.o: $(OUTPUT)util/%-flex.c $(OUTPUT)PERF-CFLAGS
-	$(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) -Iutil/ -Wno-redundant-decls -Wno-switch-default -Wno-unused-function $<
+	$(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) -Iutil/ -w $<
 
 $(OUTPUT)util/%-bison.o: $(OUTPUT)util/%-bison.c $(OUTPUT)PERF-CFLAGS
-	$(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) -DYYENABLE_NLS=0 -DYYLTYPE_IS_TRIVIAL=0 -Iutil/ -Wno-redundant-decls -Wno-switch-default -Wno-unused-function $<
+	$(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) -DYYENABLE_NLS=0 -DYYLTYPE_IS_TRIVIAL=0 -Iutil/ -w $<
 
 $(OUTPUT)%.o: %.c $(OUTPUT)PERF-CFLAGS
 	$(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) $<
#1 lore raw

[tip:perf/urgent] perf: Turn off compiler warnings for flex and bison generated files

Commit-ID:  09c0211c0bb0e40231e6ee9a35041d467ed72f16
Gitweb:     http://git.kernel.org/tip/09c0211c0bb0e40231e6ee9a35041d467ed72f16
Author:     Greg Kroah-Hartman <[email protected]>
AuthorDate: Fri, 4 May 2012 11:32:54 -0700
Committer:  Ingo Molnar <[email protected]>
CommitDate: Mon, 7 May 2012 10:03:01 +0200

perf: Turn off compiler warnings for flex and bison generated files

We don't know what types of warnings different versions of flex and bison combined with different versions of gcc is going to generate, so just punt and don't warn about anything.

This fixes the build of perf for me on an openSUSE 12.1 system.

---
 tools/perf/Makefile |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
tools/perf/Makefile +2 -2
index 9bf3fc7..92271d3 100644
@@ -774,10 +774,10 @@ $(OUTPUT)perf.o perf.spec \
 # over the general rule for .o
 
 $(OUTPUT)util/%-flex.o: $(OUTPUT)util/%-flex.c $(OUTPUT)PERF-CFLAGS
-	$(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) -Iutil/ -Wno-redundant-decls -Wno-switch-default -Wno-unused-function $<
+	$(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) -Iutil/ -w $<
 
 $(OUTPUT)util/%-bison.o: $(OUTPUT)util/%-bison.c $(OUTPUT)PERF-CFLAGS
-	$(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) -DYYENABLE_NLS=0 -DYYLTYPE_IS_TRIVIAL=0 -Iutil/ -Wno-redundant-decls -Wno-switch-default -Wno-unused-function $<
+	$(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) -DYYENABLE_NLS=0 -DYYLTYPE_IS_TRIVIAL=0 -Iutil/ -w $<
 
 $(OUTPUT)%.o: %.c $(OUTPUT)PERF-CFLAGS
 	$(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) $<