mirror of https://github.com/mpv-player/mpv
build: add some warning cflags
These were in the old configure script too. Two flags are explicitly tested, because I have no idea how widespread support for them is, and testing them is just easier than trying to look them up in various gcc/clang manuals. There are people using gcc 4.2 out there, so some caution is warranted.
This commit is contained in:
parent
adf20c9775
commit
fe4526195a
|
@ -26,13 +26,15 @@ def __add_generic_flags__(ctx):
|
||||||
ctx.env.CFLAGS += ['-g']
|
ctx.env.CFLAGS += ['-g']
|
||||||
|
|
||||||
def __add_gcc_flags__(ctx):
|
def __add_gcc_flags__(ctx):
|
||||||
ctx.env.CFLAGS += ["-Wundef", "-Wmissing-prototypes",
|
ctx.env.CFLAGS += ["-Wall", "-Wundef", "-Wmissing-prototypes", "-Wshadow",
|
||||||
"-Wno-switch", "-Wno-parentheses", "-Wpointer-arith",
|
"-Wno-switch", "-Wno-parentheses", "-Wpointer-arith",
|
||||||
"-Wredundant-decls", "-Wno-pointer-sign",
|
"-Wredundant-decls", "-Wno-pointer-sign",
|
||||||
"-Werror=implicit-function-declaration",
|
"-Werror=implicit-function-declaration",
|
||||||
"-Wno-error=deprecated-declarations",
|
"-Wno-error=deprecated-declarations",
|
||||||
"-Wno-error=unused-function" ]
|
"-Wno-error=unused-function" ]
|
||||||
__test_and_add_flags__(ctx, ["-Wempty-body"])
|
__test_and_add_flags__(ctx, ["-Wempty-body"])
|
||||||
|
__test_and_add_flags__(ctx, ["-Wdisabled-optimization"])
|
||||||
|
__test_and_add_flags__(ctx, ["-Wstrict-prototypes"])
|
||||||
|
|
||||||
def __add_clang_flags__(ctx):
|
def __add_clang_flags__(ctx):
|
||||||
ctx.env.CFLAGS += ["-Wno-logical-op-parentheses", "-fcolor-diagnostics",
|
ctx.env.CFLAGS += ["-Wno-logical-op-parentheses", "-fcolor-diagnostics",
|
||||||
|
|
Loading…
Reference in New Issue