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:
wm4 2014-05-14 20:27:24 +02:00
parent adf20c9775
commit fe4526195a
1 changed files with 3 additions and 1 deletions

View File

@ -26,13 +26,15 @@ def __add_generic_flags__(ctx):
ctx.env.CFLAGS += ['-g']
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",
"-Wredundant-decls", "-Wno-pointer-sign",
"-Werror=implicit-function-declaration",
"-Wno-error=deprecated-declarations",
"-Wno-error=unused-function" ]
__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):
ctx.env.CFLAGS += ["-Wno-logical-op-parentheses", "-fcolor-diagnostics",