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 87979 - PATCH: add G_GNUC_DEPRECATED
PATCH: add G_GNUC_DEPRECATED
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: general
2.0.x
Other Linux
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2002-07-12 00:38 UTC by Tom Tromey
Modified: 2011-02-18 15:55 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch to add G_GNUC_DEPRECATED (4.85 KB, patch)
2002-07-12 00:39 UTC, Tom Tromey
none Details | Review

Description Tom Tromey 2002-07-12 00:38:28 UTC
gcc 3.1 added __attribute__((__deprecated__)).
This can be applied to typedefs, variables, and functions.

I thought it would be useful to have this in glib.
That way programmers can use -Wdeprecated to see if their
source needs to be updated.  This would be particularly
useful for gtk, I think.

So I wrote the attached patch.  It adds this support and
marks all the functions that are deprecated (as determined
by searching *.h for the word "deprecated").

I haven't written the corresponding Gtk patch.

I think it would make sense for this patch to be applied to the
next stable release of glib.  That way the benefits will be
realized as soon as possible.
Comment 1 Tom Tromey 2002-07-12 00:39:33 UTC
Created attachment 9821 [details] [review]
Patch to add G_GNUC_DEPRECATED
Comment 2 Owen Taylor 2002-07-26 20:14:49 UTC
Hmm, how does this interact with GTK_DISABLE_DEPRECATED
G_DISABLE_DEPRECATED, etc? (see bug 72760 which asks
for a global way to turn them all on).

I guess the advantage of -Wdeprecated is that you can
turn the warnings on without having to fix things
(you'll get miscompilations with GTK_DISABLE_DEPRECATED
because of missing prototypes) but on the other hand it is GCC 
specific, and it is hard to turn on warnings for an 
entire file since every object would need to be marked
individually. (Huge pain for say, gtkclist.c)

I don't have any objections to adding the extra attribute
(but for 2.2, I want to hold the line in the sand about
API additions for 2.0.x) but I'm not sure we'd want to 
replace our current deprecation mechanism with it.

Comment 3 Owen Taylor 2002-11-21 20:48:50 UTC
Thu Nov 21 14:09:44 2002  Owen Taylor  <otaylor@redhat.com>

        * glib/gmacros.h: Add G_GNUC_DEPRECATED. (Tom Tromey,
        #87969)

Didn't actually use it anywhere since we have the other 
deprecation mechanism, and I don't think using both makes
sense.