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 676100 - need G_GNUC_PURE instead of G_GNUC_CONST for _get_type() functions
need G_GNUC_PURE instead of G_GNUC_CONST for _get_type() functions
Status: RESOLVED DUPLICATE of bug 64994
Product: glib
Classification: Platform
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2012-05-15 14:28 UTC by Colin Walters
Modified: 2012-05-15 14:31 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Colin Walters 2012-05-15 14:28:11 UTC
From the GCC manual:

`const'
     Many functions do not examine any values except their arguments,
     and have no effects except the return value.  Basically this is
     just slightly more strict class than the `pure' attribute below,
     since function is not allowed to read global memory.

But _get_type() functions obviously *do* read global memory, so it's wrong for us to annotate them as const.  What we really mean is "pure":

`pure'
     Many functions have no effects except the return value and their
     return value depends only on the parameters and/or global
     variables.  Such a function can be subject to common subexpression
     elimination and loop optimization just as an arithmetic operator
     would be.
Comment 1 Colin Walters 2012-05-15 14:31:47 UTC

*** This bug has been marked as a duplicate of bug 64994 ***