perf tools: Substract -Wformat-nonliteral from Wformat=2 in extra flags
authorFrederic Weisbecker <fweisbec@gmail.com>
Sun, 16 Aug 2009 15:52:07 +0000 (17:52 +0200)
committerIngo Molnar <mingo@elte.hu>
Sun, 16 Aug 2009 15:56:09 +0000 (17:56 +0200)
The soon coming perf trace needs to use printf with dynamically
built formats.

But we are using -Wformat=2 which is a shortcut for the
following set: -Wformat -Wformat-security -Wformat-y2k
-Wformat-nonliteral

-Wformat-nonliteral warns when it can't check formats because
they are not builtin constant strings, but we want to feature
dynamic formats. What we want instead is Wformat=2 minus
-Wformat-nonliteral, which is what this patch does.

Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Mike Galbraith <efault@gmx.de>
LKML-Reference: <1250437927-25490-1-git-send-email-fweisbec@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
tools/perf/Makefile

index d637aea..5d54ddb 100644 (file)
@@ -169,7 +169,7 @@ endif
 #
 # Include saner warnings here, which can catch bugs:
 #
-EXTRA_WARNINGS = -Wcast-align -Wformat=2 -Wshadow -Winit-self -Wpacked -Wredundant-decls -Wstack-protector -Wstrict-aliasing=3 -Wswitch-default -Wswitch-enum -Wno-system-headers -Wundef -Wvolatile-register-var -Wwrite-strings -Wbad-function-cast -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wold-style-definition -Wstrict-prototypes -Wdeclaration-after-statement
+EXTRA_WARNINGS = -Wcast-align -Wformat -Wformat-security -Wformat-y2k -Wshadow -Winit-self -Wpacked -Wredundant-decls -Wstack-protector -Wstrict-aliasing=3 -Wswitch-default -Wswitch-enum -Wno-system-headers -Wundef -Wvolatile-register-var -Wwrite-strings -Wbad-function-cast -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wold-style-definition -Wstrict-prototypes -Wdeclaration-after-statement
 
 CFLAGS = $(M64) -ggdb3 -Wall -Wextra -std=gnu99 -Werror -O6 -fstack-protector-all -D_FORTIFY_SOURCE=2 $(EXTRA_WARNINGS)
 LDFLAGS = -lpthread -lrt -lelf -lm