g_warning_once fails to build with clang++
When building Inkscape 1.1.2 after upgrading to GLib 2.72.0, using Nix on MacOS (Clang 11.1.0), the build fails:
FAILED: src/CMakeFiles/inkscape_base.dir/style.cpp.o
/nix/store/cvz17hkb0wpbsyx58l4zcaamqs2bhlmz-clang-wrapper-11.1.0/bin/clang++ -DBOOST_ALL_NO_LIB -DBOOST_ATOMIC_DYN_LINK -DBOOST_FILESYSTEM_DYN_LINK -DHAVE_CONFIG_H -DWITH_CSSBLEND -DWITH_CSSCOMPOSITE -DWITH_MESH -DWITH_SVG2 -Dinkscape_base_EXPORTS -I/tmp/nix-build-inkscape-1.1.2.drv-0/inkscape-1.1.2_2022-02-04_0a00cf5339/build/src -I/tmp/nix-build-inkscape-1.1.2.drv-0/inkscape-1.1.2_2022-02-04_0a00cf5339/src -I/tmp/nix-build-inkscape-1.1.2.drv-0/inkscape-1.1.2_2022-02-04_0a00cf5339 -I/tmp/nix-build-inkscape-1.1.2.drv-0/inkscape-1.1.2_2022-02-04_0a00cf5339/build/include -I/tmp/nix-build-inkscape-1.1.2.drv-0/inkscape-1.1.2_2022-02-04_0a00cf5339/src/3rdparty/adaptagrams -isystem /nix/store/63kwin2fgn75gifvyw4ll1p7apcl61id-glib-2.72.0-dev/include/glib-2.0 -isystem /nix/store/j5ljn0cxh1pg2906217477swf8h34223-glib-2.72.0/lib/glib-2.0/include -isystem /nix/store/yq7zb9ab5j8zwjycbq1pka562f5f25zf-pango-1.50.6-dev/include/pango-1.0 -isystem /nix/store/w2kp0czx9hd53mq5kd9gh0acb5ysvw6w-harfbuzz-3.3.2-dev/include/harfbuzz -isystem /nix/store/ja09rl9a90jcjnlmmr130b5m76c5z56r-libsoup-2.74.2-dev/include/libsoup-2.4 -isystem /nix/store/6wrqyhsij3cc1d18dk0n3g3555khjp71-poppler-glib-22.03.0-dev/include/poppler -isystem /nix/store/8l4fgi8jx4kr1n0vnsp0q9izxd5a5f1j-librevenge-0.0.4/include/librevenge-0.0 -isystem /nix/store/28dcg5cia7y0nj6msi5gcf068wg2klxa-libwpg-0.3.3/include/libwpg-0.3 -isystem /nix/store/1nfq6641dyapwwvdf9ph1wna8qk9sr6b-libvisio-0.1.7-dev/include/libvisio-0.1 -isystem /nix/store/iych9mrjnhj5n9kkrzkh50fsa56hi26q-libcdr-0.1.6/include/libcdr-0.1 -isystem /nix/store/dip52q07kxfxi8y29rr63c783gv3417v-gtk+3-3.24.33-dev/include/gtk-3.0 -isystem /nix/store/qg48ifvr5an4g42qaki89swg7fnwhya2-atk-2.36.0-dev/include/atk-1.0 -isystem /nix/store/4hq3i5yp8qlyi4hhwg2chb45fq3c3sfg-gdk-pixbuf-2.42.8-dev/include/gdk-pixbuf-2.0 -isystem /nix/store/l9aw1w85sffhc1w6did8f6f7bda9smwi-gtk-mac-integration-3.0.1/include/gtkmacintegration -isystem /nix/store/94n817nj55qv1icj933rj0gf4cyhhcn1-glibmm-2.66.2-dev/include/giomm-2.4 -isystem /nix/store/yf15dyg5c229bj5b4vsb48kny4wwyk6d-glibmm-2.66.2/lib/giomm-2.4/include -isystem /nix/store/94n817nj55qv1icj933rj0gf4cyhhcn1-glibmm-2.66.2-dev/include/glibmm-2.4 -isystem /nix/store/yf15dyg5c229bj5b4vsb48kny4wwyk6d-glibmm-2.66.2/lib/glibmm-2.4/include -isystem /nix/store/vhh9brdbws5c0b5ygzlslvd50vipr9f9-libsigc++-2.10.8/include/sigc++-2.0 -isystem /nix/store/vhh9brdbws5c0b5ygzlslvd50vipr9f9-libsigc++-2.10.8/lib/sigc++-2.0/include -isystem /nix/store/indb1fvl5cdkq2kz0kj2nq4dflcplj2m-gtkmm-3.24.5-dev/include/gtkmm-3.0 -isystem /nix/store/v2g2khwmwwp3wjyizg7f0paxbs1q5pd9-gtkmm-3.24.5/lib/gtkmm-3.0/include -isystem /nix/store/indb1fvl5cdkq2kz0kj2nq4dflcplj2m-gtkmm-3.24.5-dev/include/gdkmm-3.0 -isystem /nix/store/v2g2khwmwwp3wjyizg7f0paxbs1q5pd9-gtkmm-3.24.5/lib/gdkmm-3.0/include -isystem /nix/store/dip52q07kxfxi8y29rr63c783gv3417v-gtk+3-3.24.33-dev/include/gtk-3.0/unix-print -isystem /nix/store/hsr1hsb23scwlfh1lr456cm4arh3hi7p-atkmm-2.28.2-dev/include/atkmm-1.6 -isystem /nix/store/4nahfi7pqxm88ms0xmr05rli58xlq2v2-atkmm-2.28.2/lib/atkmm-1.6/include -isystem /nix/store/9qps6qrln13s0jc996cs67hclvvq5lvf-cairomm-1.14.3-dev/include/cairomm-1.0 -isystem /nix/store/j9a8wlpjvjdn8magy5gm6ws06hqfa68l-cairomm-1.14.3/lib/cairomm-1.0/include -isystem /nix/store/9gn4iihhn1kb7wgjvhkkfj9rsifpyk7j-pangomm-2.46.2-dev/include/pangomm-1.4 -isystem /nix/store/1kgvh1b8yg7p8i61a2rvsqn1b1s63v8r-pangomm-2.46.2/lib/pangomm-1.4/include -isystem /nix/store/2pnymg9dw0z1p1hpc08m4ibdiz2c8rk8-libxml2-2.9.13-dev/include/libxml2 -isystem /nix/store/gi8mcwhd7rhslav6zcr5qzyj072pklrp-lib2geom-1.1-dev/include/2geom-1.1.0 -DG_DISABLE_ASSERT -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fstack-protector-strong -Werror=format -Werror=format-security -Wno-switch -O3 -DNDEBUG -fPIC -fPIC -fdiagnostics-color -std=gnu++17 -MD -MT src/CMakeFiles/inkscape_base.dir/style.cpp.o -MF src/CMakeFiles/inkscape_base.dir/style.cpp.o.d -o src/CMakeFiles/inkscape_base.dir/style.cpp.o -c /tmp/nix-build-inkscape-1.1.2.drv-0/inkscape-1.1.2_2022-02-04_0a00cf5339/src/style.cpp
/tmp/nix-build-inkscape-1.1.2.drv-0/inkscape-1.1.2_2022-02-04_0a00cf5339/src/style.cpp:687:13: error: cannot initialize a parameter of type 'int *' with an rvalue of type 'void *'
g_warning_once("attribute 'clip-path' given as CSS");
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/nix/store/63kwin2fgn75gifvyw4ll1p7apcl61id-glib-2.72.0-dev/include/glib-2.0/glib/gmessages.h:490:9: note: expanded from macro 'g_warning_once'
if (g_atomic_int_compare_and_exchange (&G_PASTE (_GWarningOnceBoolean, __LINE__), \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/nix/store/63kwin2fgn75gifvyw4ll1p7apcl61id-glib-2.72.0-dev/include/glib-2.0/glib/gatomic.h:160:44: note: expanded from macro 'g_atomic_int_compare_and_exchange'
__atomic_compare_exchange_n ((atomic), (void *) (&(gaicae_oldval)), (newval), FALSE, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST) ? TRUE : FALSE; \
^~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/nix-build-inkscape-1.1.2.drv-0/inkscape-1.1.2_2022-02-04_0a00cf5339/src/style.cpp:698:13: error: cannot initialize a parameter of type 'int *' with an rvalue of type 'void *'
g_warning_once("attribute 'mask' given as CSS");
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/nix/store/63kwin2fgn75gifvyw4ll1p7apcl61id-glib-2.72.0-dev/include/glib-2.0/glib/gmessages.h:490:9: note: expanded from macro 'g_warning_once'
if (g_atomic_int_compare_and_exchange (&G_PASTE (_GWarningOnceBoolean, __LINE__), \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/nix/store/63kwin2fgn75gifvyw4ll1p7apcl61id-glib-2.72.0-dev/include/glib-2.0/glib/gatomic.h:160:44: note: expanded from macro 'g_atomic_int_compare_and_exchange'
__atomic_compare_exchange_n ((atomic), (void *) (&(gaicae_oldval)), (newval), FALSE, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST) ? TRUE : FALSE; \
^~~~~~~~~~~~~~~~~~~~~~~~~~~
2 errors generated.
Possibly related to !2114 (merged).
Edited by Jan Tojnar