This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH]: __attribute__((deprecated))
On Dec 14, 2001, Ira Ruben <ira@apple.com> wrote:
> At 9:42 PM -0200 12/14/01, Alexandre Oliva wrote:
>> It may well be that, whenever T1 is removed, T2 is going to be
>> defined to something else.
> But you are saying that only objects* explicitly* deprecated cause
> their uses to be warned. Thus "T2 y;" and "typedef T2 T4;" are not
> warned. I don't understand why you would want that to happen.
See above. What I had in mind was that warning only about things
explicitly marked as deprecated is more flexible, because it allows
one to keep on using a deprecated feature indirectly, until the time
comes of removing the deprecated thing, in which case the
non-deprecated one must be defined to something else.
I'm not even sure I buy this myself. If you want to deprecated T1 but
keep T2 around, not deprecated, you might as well do:
typedef original_T1 T;
typedef T T1 ATTRIBUTE_DEPRECATED;
typedef T T2; // this is not deprecated
Still, not marking all indirect uses of a deprecated feature, instead
marking only uses of explicitly deprecated feature, would help reduce
the number of false positives should `typedef T1 T2;' be part of user
code. I'd rather have the warning only at the point where I use the
deprecated type, not all over the place, which would make it hard to
find all and only uses of the deprecated feature in my program. I.e.,
if I use 10 deprecated features in 10 places of my program, I get 10
warnings, not 2037 from the 10 explicit uses plus 2027 from the other
uses of my typedefs. C-x ` would help me fix my program more quickly
should I get only the 10 warnings, if you understand what I mean :-)
--
Alexandre Oliva Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist *Please* write to mailing lists, not to me