meson: Enable more compiler warnings

This provides parity with what we did in Autotools (most of it via
AX_COMPILER_FLAGS_CFLAGS).

Signed-off-by: Simon McVittie <smcv@collabora.com>
This commit is contained in:
Simon McVittie 2022-07-15 11:38:26 +01:00
parent 12a8c8a352
commit ee36404549

View file

@ -1055,12 +1055,51 @@ else
'-Wno-missing-field-initializers',
'-Wno-unused-parameter',
# General warnings for both C and C++
# TODO: Some of these are probably redundant with Meson's warning_level
'-Warray-bounds',
'-Wcast-align',
'-Wchar-subscripts',
'-Wdouble-promotion',
'-Wduplicated-branches',
'-Wduplicated-cond',
'-Wfloat-equal',
'-Wformat-nonliteral',
'-Wformat-security',
'-Wformat=2',
'-Winit-self',
'-Winline',
'-Wlogical-op',
'-Wmissing-declarations',
'-Wmissing-format-attribute',
'-Wmissing-include-dirs',
'-Wmissing-noreturn',
'-Wnull-dereference',
'-Wpacked',
'-Wpointer-arith',
'-Wredundant-decls',
'-Wrestrict',
'-Wreturn-type',
'-Wshadow',
'-Wsign-compare',
'-Wstrict-aliasing',
'-Wswitch-default',
'-Wswitch-enum',
'-Wundef',
'-Wunused-but-set-variable',
'-Wwrite-strings',
]
compile_warnings_c += [
# Extra warnings just for C
'-Wdeclaration-after-statement',
'-Wimplicit-function-declaration',
'-Wjump-misses-init',
'-Wmissing-prototypes',
'-Wnested-externs',
'-Wold-style-definition',
'-Wpointer-sign',
'-Wstrict-prototypes',
]
endif