mirror of https://github.com/mpv-player/mpv
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:
parent
5758a47902
commit
592aa9c70c
|
@ -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",
|
||||
|
|
Loading…
Reference in New Issue