Commit 4e0a1502 authored by Debarshi Ray's avatar Debarshi Ray

build: Add the remaining -Wextra warnings in GCC 8 to the Meson build

The Autotools build uses -Wextra because it's on the AX_COMPILER_FLAGS
list. However, using -Wextra directly is problematic because newer
compilers can add more warnings to the -Wextra umbrella, and some of
them might not be fit for this codebase. eg., GCC 8 added
-Wcast-function-type, which can't be sanely used with the GNOME
platform (see commit bb290a1e). This is why the Meson build
tries to avoid -Wextra. Instead, it is better to explicitly list out
the desired warnings from the -Wextra umbrella.

The warnings that were explicitly listed out in AX_COMPILER_FLAGS were
already present in the initial port to Meson. This fills in the rest
that weren't explicitly listed but were still enabled by -Wextra.
parent 81693cd0
Pipeline #32709 passed with stage
in 20 minutes and 31 seconds
......@@ -76,17 +76,24 @@ endif
common_flags += cc.get_supported_arguments([
'-fno-strict-aliasing',
'-Wcast-align',
'-Wclobbered',
'-Wdeclaration-after-statement',
'-Wempty-body',
'-Wformat=2',
'-Wignored-qualifiers',
'-Wimplicit-fallthrough=3',
'-Winit-self',
'-Winline',
'-Wmissing-declarations',
'-Wmissing-field-initializers',
'-Wmissing-format-attribute',
'-Wmissing-include-dirs',
'-Wmissing-noreturn',
'-Wmissing-parameter-type',
'-Wmissing-prototypes',
'-Wnested-externs',
'-Wold-style-definition',
'-Woverride-init',
'-Wpacked',
'-Wpointer-arith',
'-Wredundant-decls',
......@@ -95,7 +102,10 @@ common_flags += cc.get_supported_arguments([
'-Wstrict-prototypes',
'-Wswitch-default',
'-Wswitch-enum',
'-Wtype-limits',
'-Wundef',
'-Wuninitialized',
'-Wunused',
'-Wwrite-strings',
])
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment