Skip to content

goaidentityutils: Correct unused result warning from g_string_free()

Milan Crha requested to merge wip/goaidentity-unused-result-g_string_free into master
[22/161] Compiling C object src/goaidentity/goa-identity-service.p/goaidentityutils.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 ../src/goaidentity/goaidentityutils.h:22,
                 from ../src/goaidentity/goaidentityutils.c:21:
../src/goaidentity/goaidentityutils.c: In function ‘goa_identity_utils_escape_object_path’:
/usr/include/glib-2.0/glib/gstring.h:72:5: warning: ignoring return value of ‘g_string_free_and_steal’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   68 |   (__builtin_constant_p (free_segment) ?        \
      |   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   69 |     ((free_segment) ?                           \
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   70 |       (g_string_free) ((str), (free_segment)) : \
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   71 |       g_string_free_and_steal (str))            \
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   72 |     :                                           \
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   73 |     (g_string_free) ((str), (free_segment)))
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/goaidentity/goaidentityutils.c:89:3: note: in expansion of macro ‘g_string_free’
   89 |   g_string_free (string, FALSE);

Merge request reports