After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 796346 - [PATCH] gmacros: Add G_GNUC_UNUSED for autoptr funcs (notably GLists)
[PATCH] gmacros: Add G_GNUC_UNUSED for autoptr funcs (notably GLists)
Status: RESOLVED OBSOLETE
Product: glib
Classification: Platform
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2018-05-22 21:06 UTC by Colin Walters
Modified: 2018-05-24 20:38 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
[PATCH] gmacros: Add G_GNUC_UNUSED for autoptr funcs (notably GLists) (2.25 KB, patch)
2018-05-22 21:06 UTC, Colin Walters
accepted-commit_now Details | Review

Description Colin Walters 2018-05-22 21:06:58 UTC
Created attachment 372346 [details] [review]
[PATCH] gmacros: Add G_GNUC_UNUSED for autoptr funcs (notably GLists)

In commit f49a93b20761a0be51b22c481503b4cda0f7264f
from bug https://bugzilla.gnome.org/show_bug.cgi?id=791342
we added two new static inline cleanup helpers in case a type was
used inside a list.

These functions will commonly be unused.

In rpm-ostree, we run a build using `CC=clang -Werror=unused` because
it catches `g_autofree char *foo = NULL;` as unused, but GCC doesn't.
When trying to update to F28 with a newer glib, our CI fell over on this.

Mark all of the autocleanups as "maybe unused".
Comment 1 Philip Withnall 2018-05-23 10:31:56 UTC
Review of attachment 372346 [details] [review]:

This seems reasonable. I’m worried we’ll regress on it in future though. Could you add -Werror=unused to the GLib CFLAGS in a separate commit, please? I assume GLib will build with that enabled for all source (and not just for its public headers).
Comment 2 Colin Walters 2018-05-23 13:23:54 UTC
We only get a warning with clang today.  I'm not too worried about regressions here, as my opinion on -Werror hasn't changed much since https://mail.gnome.org/archives/desktop-devel-list/2012-July/msg00100.html - the only evolution is that in CI scenarios, it *can* make sense to use a blanket -Werror if you're using a "fixed" toolchain.  Which is in fact what was going on here.
Comment 3 GNOME Infrastructure Team 2018-05-24 20:38:15 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/glib/issues/1390.