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 790877 - fix non-portable check in G_GNUC_CHECK_VERSION
fix non-portable check in G_GNUC_CHECK_VERSION
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2017-11-27 00:01 UTC by Christian Hergert
Modified: 2017-11-27 10:08 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
macros: make G_GNUC_CHECK_VERSION() portable (1.18 KB, patch)
2017-11-27 00:01 UTC, Christian Hergert
committed Details | Review

Description Christian Hergert 2017-11-27 00:01:17 UTC
A few years back in bug 728099 I added G_GNUC_CHECK_VERSION(). That now warns with recent GCC versions about possibly non-portable use of defined() in a macro expansion.

We can fix this fairly easily.
Comment 1 Christian Hergert 2017-11-27 00:01:34 UTC
Created attachment 364467 [details] [review]
macros: make G_GNUC_CHECK_VERSION() portable

This removes the use of defined() in a macro expansion, which may not be
portable to some pre-processors. Instead, we hoist the defined check
outside the macro expansion.
Comment 2 Philip Withnall 2017-11-27 08:38:01 UTC
Review of attachment 364467 [details] [review]:

Good hoisting. ++
Comment 3 Christian Hergert 2017-11-27 10:08:07 UTC
Thanks for the prompt review!

Attachment 364467 [details] pushed as d44afba - macros: make G_GNUC_CHECK_VERSION() portable