summaryrefslogtreecommitdiffstats
path: root/waftools
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-12-17 22:24:20 +0100
committerwm4 <wm4@nowhere>2014-12-17 22:24:20 +0100
commit592aa9c70c1d7cbde1240b40ba6a285469d7d6b1 (patch)
treee36f3a3488669a5150d2663429868608a8d21879 /waftools
parent5758a47902a0ca80a823ef6e3b22e56d88124fc4 (diff)
downloadmpv-592aa9c70c1d7cbde1240b40ba6a285469d7d6b1.tar.bz2
mpv-592aa9c70c1d7cbde1240b40ba6a285469d7d6b1.tar.xz
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.
Diffstat (limited to 'waftools')
-rw-r--r--waftools/detections/compiler.py12
1 files changed, 7 insertions, 5 deletions
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",