build: Add -Wno-pedantic flag to compiler arguments

We do not support building with -Wpedantic due pervasively casting
function pointers through (void*) — see
https://wiki.gnome.org/Projects/GLib/CompilerRequirements#Function_pointer_conversions.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

Helps https://gitlab.gnome.org/GNOME/glib/issues/1662
This commit is contained in:
Philip Withnall 2019-01-23 13:38:40 +00:00
parent 7035462da0
commit 5c05af9aca

View File

@ -355,6 +355,9 @@ if cc.get_id() == 'gcc' or cc.get_id() == 'clang'
# Due to pervasive use of things like GPOINTER_TO_UINT(), we do not support
# building with -Wbad-function-cast.
'-Wno-bad-function-cast',
# Due to function casts through (void*) we cannot support -Wpedantic:
# https://wiki.gnome.org/Projects/GLib/CompilerRequirements#Function_pointer_conversions.
'-Wno-pedantic',
'-Werror=declaration-after-statement',
'-Werror=format=2',
'-Werror=implicit-function-declaration',