Meson build fail when '--warnlevel 3' option is called
I noticed that the meson build process fail when the flag --warnlevel 3
is given at config time:
#> meson --buildtype debug --warnlevel 3 build-fail/ glib.git/
...
#> cd build-fail --warnlevel 3
#> ninja -v
[1/1064] cc -Iglib/4430778@@glib-2.0@sha -Iglib -I../glib.git/glib -I. -I../glib.git/ -fdiagnostics-color=always -pipe
-D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -Wpedantic -std=gnu89 -g -D_GNU_SOURCE
-fno-strict-aliasing -DG_ENABLE_DEBUG -Wall -Wduplicated-branches -Wimplicit-fallthrough
-Wmisleading-indentation -Wstrict-prototypes -Wunused -Wno-bad-function-cast
-Werror=declaration-after-statement -Werror=format=2 -Werror=implicit-function-declaration
-Werror=init-self -Werror=missing-include-dirs -Werror=missing-prototypes -Werror=pointer-arith -fPIC
-pthread '-DG_LOG_DOMAIN="GLib"' -DGLIB_COMPILATION -fvisibility=hidden -MD -MQ
'glib/4430778@@glib-2.0@sha/gtrashstack.c.o' -MF 'glib/4430778@@glib-2.0@sha/gtrashstack.c.o.d'
-o 'glib/4430778@@glib-2.0@sha/gtrashstack.c.o' -c ../glib.git/glib/gtrashstack.c
...
... 8< ...
...
In file included from glib/glibconfig.h:9,
from ../glib.git/glib/gtypes.h:32,
from ../glib.git/glib/gutils.h:32,
from ../glib.git/glib/gmem.h:32,
from ../glib.git/glib/guniprop.c:27:
../glib.git/glib/guniprop.c: In function ‘g_utf8_strup’:
../glib.git/glib/gmacros.h:312:39: warning: ISO C does not support ‘__FUNCTION__’ predefined identifier [-Wpedantic]
#define G_STRFUNC ((const char*) (__FUNCTION__))
^~~~~~~~~~~~
../glib.git/glib/gmessages.h:604:35: note: in expansion of macro ‘G_STRFUNC’
G_STRFUNC, \
^~~~~~~~~
../glib.git/glib/guniprop.c:915:3: note: in expansion of macro ‘g_return_val_if_fail’
g_return_val_if_fail (str != NULL, NULL);
^~~~~~~~~~~~~~~~~~~~
../glib.git/glib/guniprop.c: In function ‘g_utf8_strdown’:
../glib.git/glib/gmacros.h:312:39: warning: ISO C does not support ‘__FUNCTION__’ predefined identifier [-Wpedantic]
#define G_STRFUNC ((const char*) (__FUNCTION__))
--warnlevel 3 ^~~~~~~~~~~~
../glib.git/glib/gmessages.h:604:35: note: in expansion of macro ‘G_STRFUNC’
G_STRFUNC, \
^~~~~~~~~
../glib.git/glib/guniprop.c:1103:3: note: in expansion of macro ‘g_return_val_if_fail’
g_return_val_if_fail (str != NULL, NULL);
^~~~~~~~~~~~~~~~~~~~
../glib.git/glib/guniprop.c: In function ‘g_utf8_casefold’:
../glib.git/glib/gmacros.h:312:39: warning: ISO C does not support ‘__FUNCTION__’ predefined identifier [-Wpedantic]
#define G_STRFUNC ((const char*) (__FUNCTION__))
^~~~~~~~~~~~
../glib.git/glib/gmessages.h:604:35: note: in expansion of macro ‘G_STRFUNC’
G_STRFUNC, \
^~~~~~~~~
../glib.git/glib/guniprop.c:1145:3: note: in expansion of macro ‘g_return_val_if_fail’
g_return_val_if_fail (str != NULL, NULL);
^~~~~~~~~~~~~~~~~~~~
ninja: build stopped: subcommand failed.
I did not dig too much into this but this occurs only when --warnlevel 3
is given (it compiles nicely with only --werror
or with --warnlevel 2
.
Also, I noticed that you compile with -std=gnu89
while having some C99 specific code in your base, is it intended ?
Edited by Emmanuel Fleury