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 319940 - Use GLIB macros for GCC extensions
Use GLIB macros for GCC extensions
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
git master
Other Linux
: Normal normal
: 0.9.6
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks: 319388
 
 
Reported: 2005-10-27 03:53 UTC by Jan Schmidt
Modified: 2005-11-21 18:41 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Jan Schmidt 2005-10-27 03:53:35 UTC
I think we should use a sprinkling of the GCC extensions macros in GLIB through
our 0.9 API. I don't think any of them actually break API, but I'm not sure.

http://rlove.org/log/2005102601 has a decent list of most of the extensions but
misses the best one: G_GNUC_NULL_TERMINATED for functions which require a null
terminator sentinel parameter.

Other interesting ones: G_GNUC_PURE, G_GNUC_MALLOC, G_GNUC_CONST
Comment 1 Andy Wingo 2005-10-27 09:06:42 UTC
re: G_GNUC_PURE and G_GNUC_CONST cf. bug #317246, bug #64994, bug #65041

i doubt that we actually have PURE and CONST functions.
Comment 2 Andy Wingo 2005-10-27 09:06:56 UTC
re: G_GNUC_PURE and G_GNUC_CONST cf. bug #317246, bug #64994, bug #65041

i doubt that we actually have PURE and CONST functions.
Comment 3 Thomas Vander Stichele 2005-10-28 17:25:45 UTC
_TERMINATED is a 2.8 macro.  We can add it to a glib-compat.h

however, the current one should:
- be moved to glib-compat-private.h
- receive an #ifndef _H, so it can be included multiple times

and a new one should be created, which will also be installed, since it needs to
be public for all others to include the header you want to use it in

it would look like this:

/* added in GLib 2.8 */
#if !GLIB_CHECK_VERSION (2, 8, 0)
#if     __GNUC__ >= 4
#define G_GNUC_NULL_TERMINATED __attribute__((__sentinel__))
#else
#define G_GNUC_NULL_TERMINATED
#endif
#endif
Comment 4 Jan Schmidt 2005-11-21 13:18:13 UTC
Let's move glib-compat.h to glib-compat-private.h and copy the GLib 2.8 specific
pieces to there.
Comment 5 Andy Wingo 2005-11-21 18:07:55 UTC
I've munged the headers appropriately, and now we have a G_GNUC_NULL_TERMINATED
that we can use.
Comment 6 Andy Wingo 2005-11-21 18:41:04 UTC
Sprinkled across the headers, foolios.