[cfe-dev] handle __attribute__((deprecated))

Chris Lattner clattner at apple.com
Fri Feb 29 08:50:38 PST 2008


On Feb 29, 2008, at 5:28 AM, Nuno Lopes wrote:

> Hi,
>
> Attached is a patch to add support for __attribute__((deprecated)).

Nice!

>
> The test currently doesn't pass because attributes aren't being  
> propagated when merging functions/vars definitions.
>
> e.g.
> void g() __attribute__((deprecated));
> void g();
>
> int a() {
> //should produce a warning. it does not as clang discards the old  
> defnition and its attributes when merging
> g();
> }

Ok, for now, I just disabled these cases from the test case.  It would  
be nice to have this but can happen as a separate step.

> This patch also makes clang trigger a warning when using an  
> attribute that isn't recognised (like gcc).

I'd prefer to only do this after we recognize the full set of builtins  
that GCC does.  Not doing so will break some system headers etc.

> If there's interest, I'll provide patches to handle other  
> __attributes__.

That would be great, thanks Nuno!
http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20080225/004488.html

-Chris



More information about the cfe-dev mailing list