From 592aa9c70c1d7cbde1240b40ba6a285469d7d6b1 Mon Sep 17 00:00:00 2001 From: wm4 Date: Wed, 17 Dec 2014 22:24:20 +0100 Subject: build: add -Werror=format-security, add -W flags in all platforms The idea of using -Werror=format-security comes from MPlayer. Try to use the compiler flags with any compiler. There's no reason not to apply them on clang. --- waftools/detections/compiler.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'waftools') diff --git a/waftools/detections/compiler.py b/waftools/detections/compiler.py index 2c22f26a1a..53b7d24892 100644 --- a/waftools/detections/compiler.py +++ b/waftools/detections/compiler.py @@ -28,17 +28,19 @@ def __add_generic_flags__(ctx): if ctx.is_debug_build(): ctx.env.CFLAGS += ['-g'] -def __add_gcc_flags__(ctx): - ctx.env.CFLAGS += ["-Wall", "-Wundef", "-Wmissing-prototypes", "-Wshadow", - "-Wno-switch", "-Wno-parentheses", "-Wpointer-arith", - "-Wredundant-decls", "-Wno-pointer-sign"] __test_and_add_flags__(ctx, ["-Werror=implicit-function-declaration", "-Wno-error=deprecated-declarations", "-Wno-error=unused-function", "-Wempty-body", "-Wdisabled-optimization", "-Wstrict-prototypes", - "-Wno-format-zero-length"]) + "-Wno-format-zero-length", + "-Werror=format-security"]) + +def __add_gcc_flags__(ctx): + ctx.env.CFLAGS += ["-Wall", "-Wundef", "-Wmissing-prototypes", "-Wshadow", + "-Wno-switch", "-Wno-parentheses", "-Wpointer-arith", + "-Wredundant-decls", "-Wno-pointer-sign"] def __add_clang_flags__(ctx): ctx.env.CFLAGS += ["-Wno-logical-op-parentheses", "-fcolor-diagnostics", -- cgit v1.2.3