meson build: warning: ignoring return value of ‘g_string_free_and_steal’
Following https://developer.gimp.org/core/setup/build/ using meson-1.2.3-1.fc39.noarch
and ninja-build-1.11.1-4.fc39.x86_64
to compile gegl
git master branch against glib2-2.78.3-1.fc39.x86_64
with the default command in those docs
meson _build \
--prefix=${GIMP_PREFIX} \
--buildtype=release \
-Db_lto=true
and running ninja
emits warnings about calling g_string_free (str, FALSE)
while ignoring its return value in three files:
- https://gitlab.gnome.org/GNOME/gegl/-/blob/2e307fe65fb36be34ee258ea084936f7b398e617/gegl/gegl-matrix.c#L331
- https://gitlab.gnome.org/GNOME/gegl/-/blob/2e307fe65fb36be34ee258ea084936f7b398e617/gegl/gegl-serialize.c#L1242
- https://gitlab.gnome.org/GNOME/gegl/-/blob/2e307fe65fb36be34ee258ea084936f7b398e617/gegl/property-types/gegl-path.c#L393
See return value docs at https://docs.gtk.org/glib/method.String.free.html and https://docs.gtk.org/glib/method.String.free_and_steal.html (the latter only available since GLib 2.76).
[ak@ac _build]$ ninja
[105/1270] Compiling C object gegl/libgegl-0.4.so.0.446.1.p/gegl-matrix.c.o
In file included from /usr/include/glib-2.0/glib/giochannel.h:36,
from /usr/include/glib-2.0/glib.h:56,
from ../gegl/gegl-matrix.h:23,
from ../gegl/gegl-matrix.c:24:
../gegl/gegl-matrix.c: In function ‘gegl_matrix3_to_string’:
/usr/include/glib-2.0/glib/gstring.h:74:5: warning: ignoring return value of ‘g_string_free_and_steal’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
70 | (__builtin_constant_p (free_segment) ? \
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
71 | ((free_segment) ? \
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
72 | (g_string_free) ((str), (free_segment)) : \
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
73 | g_string_free_and_steal (str)) \
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
74 | : \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
75 | (g_string_free) ((str), (free_segment)))
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../gegl/gegl-matrix.c:331:3: note: in expansion of macro ‘g_string_free’
331 | g_string_free (str, FALSE);
| ^~~~~~~~~~~~~
[117/1270] Compiling C object gegl/libgegl-0.4.so.0.446.1.p/gegl-serialize.c.o
In file included from /usr/include/glib-2.0/glib/giochannel.h:36,
from /usr/include/glib-2.0/glib.h:56,
from /usr/include/glib-2.0/gobject/gbinding.h:30,
from /usr/include/glib-2.0/glib-object.h:24,
from ../gegl/gegl.h:22,
from ../gegl/gegl-serialize.c:20:
../gegl/gegl-serialize.c: In function ‘gegl_serialize2’:
/usr/include/glib-2.0/glib/gstring.h:74:5: warning: ignoring return value of ‘g_string_free_and_steal’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
70 | (__builtin_constant_p (free_segment) ? \
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
71 | ((free_segment) ? \
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
72 | (g_string_free) ((str), (free_segment)) : \
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
73 | g_string_free_and_steal (str)) \
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
74 | : \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
75 | (g_string_free) ((str), (free_segment)))
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../gegl/gegl-serialize.c:1242:3: note: in expansion of macro ‘g_string_free’
1242 | g_string_free (str, FALSE);
| ^~~~~~~~~~~~~
[206/1270] Compiling C object gegl/libgegl-0.4.so.0.446.1.p/property-types_gegl-path.c.o
In file included from /usr/include/glib-2.0/glib/giochannel.h:36,
from /usr/include/glib-2.0/glib.h:56,
from /usr/include/glib-2.0/gobject/gbinding.h:30,
from /usr/include/glib-2.0/glib-object.h:24,
from ../gegl/gegl.h:22,
from ../gegl/property-types/gegl-path.c:26:
../gegl/property-types/gegl-path.c: In function ‘gegl_path_to_string’:
/usr/include/glib-2.0/glib/gstring.h:74:5: warning: ignoring return value of ‘g_string_free_and_steal’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
70 | (__builtin_constant_p (free_segment) ? \
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
71 | ((free_segment) ? \
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
72 | (g_string_free) ((str), (free_segment)) : \
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
73 | g_string_free_and_steal (str)) \
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
74 | : \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
75 | (g_string_free) ((str), (free_segment)))
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../gegl/property-types/gegl-path.c:393:3: note: in expansion of macro ‘g_string_free’
393 | g_string_free (str, FALSE);
| ^~~~~~~~~~~~~