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.
This commit is contained in:
wm4 2014-12-17 22:24:20 +01:00
parent 5758a47902
commit 592aa9c70c
1 changed files with 7 additions and 5 deletions

View File

@ -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",