glib 2.71.0 muslc - build error missing sentinel in function call
I have tried to compile glib 2.71.0 with muslc in alpine. The build failed with the following error:
ninja: job failed: g++ -Iglib/tests/cxx.p -Iglib/tests -I../glib/tests -I. -I.. -Iglib -I../glib -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wnon-virtual-dtor -Wextra -Wpedantic -Wduplicated-branches -Wimplicit-fallthrough -Wmisleading-indentation -Wunused -Wno-unused-parameter -Wno-cast-function-type -Wno-pedantic -Wno-format-zero-length -Wno-variadic-macros -Werror=format=2 -Werror=init-self -Werror=missing-include-dirs -Werror=pointer-arith -Os -fomit-frame-pointer -g -Os -fomit-frame-pointer -fPIE -pthread -MD -MQ glib/tests/cxx.p/cxx.cpp.o -MF glib/tests/cxx.p/cxx.cpp.o.d -o glib/tests/cxx.p/cxx.cpp.o -c ../glib/tests/cxx.cpp
../glib/tests/cxx.cpp: In function 'int main(int, char**)':
../glib/tests/cxx.cpp:60:15: error: missing sentinel in function call [-Werror=format=]
60 | g_test_init (&argc, &argv, NULL);
| ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
cc1plus: some warnings being treated as errors
I have figured out, that this problem disappears when replacing the NULL
with nullptr
. However, I don't really understand the details, so I thought I should rather open an issue than directly send a MR. Would it be possible to just apply that change? Might that change need to be wrapped in an #if __cplusplus >= 201103L
? Or is the solution more complex?