This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH]: __attribute__((deprecated))
At 9:42 PM -0200 12/14/01, Alexandre Oliva wrote:
>On Dec 14, 2001, Ira Ruben <ira@apple.com> wrote:
>
>> 1. typedef int T1 __attribute__ ((deprecated));
>> 2. T1 x;
> > 3. typedef T1 T2;
>> 4. T2 y;
>> 5. typedef T2 T3 __attribute__ ((deprecated));
>> 6. T3 z __attribute__ ((deprecated));
>
>> no warning is issued
>> for line 5 even though T3 is defined in terms of deprecated T2
>> because T3 itself is being explicitly deprecated.
>
>How about:
>
>typedef T2 T4;
>
>IMO, it shouldn't generate a warning, because I'm not using anything
>that is explicitly deprecated. It may well be that, whenever T1 is
>removed, T2 is going to be defined to something else. Otherwise, IMO,
>it should be explicitly marked as deprecated. In fact, I'd prefer if
>4. didn't generate a warning.
>
>Thoughts?
I've been thinking more about what your are saying. Is it that you
just want to reduce the number of repetitive warnings? Thus it's
sufficient to say that "typedef T1 T2;" is warned because it's
defined in terms of a deprecated object and thus there is no need to
warn for any uses of T2. Correct? If so, I think that is equally
reasonable. Less code too :-)
Ira