This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
__attribute__ ((deprecated))
- To: gcc at gcc dot gnu dot org
- Subject: __attribute__ ((deprecated))
- From: Stan Shebs <shebs at apple dot com>
- Date: Mon, 23 Apr 2001 19:29:09 -0700
Now that Mac OS X has had its first release, the library people are
already thinking of ways to change the API for the next release
(hopefully for the better, but I won't editorialize further. :-) )
To help out developers, they've asked that the compiler support some
way to warn people that a particular function or variable may
go away or be changed at some point.
The obvious thing would be to add a new attribute, so that a header
could have something like
extern int old_bad_fn (int) __attribute__ ((deprecated));
then any calls or references to old_bad_fn would get something like
warning: old_bad_fn is deprecated
As an enhancement, the library folks would also like to be able
to add a more specific message:
extern int worse_fn (char)
__attribute__ ((deprecated "use new_good_fn instead"));
to get
warning: worse_fn is deprecated; use new_good_fn instead
Before we jump into implementing this, we'd like to get some input.
1. Does this seem like a worthwhile feature to add?
2. If no, what would be an equivalent alternative?
3. If yes, what are the implementation caveats to watch out for?
(needs to work for all of C/ObjC/C++)
Thanks for any and all advice!
Stan