[cfe-commits] [PATCH] Don't apply function attributes to the return type

John McCall rjmccall at apple.com
Tue Feb 23 15:05:06 PST 2010


On Feb 23, 2010, at 11:51 AM, Charles Davis wrote:
> This patch fixes part of PR6408. It teaches clang not to try to apply
> function attributes to the return type of a function. GCC never does
> this, so neither should we.


Is this actually what gcc does?  The documentation I've seen suggested that gcc tries to apply a function type attribute in the decl spec to the return type if it's a function pointer, and otherwise tries to apply it to the function itself.  But maybe I'm misinterpreting it, or maybe that documentation is incorrect:
  http://developer.apple.com/mac/library/DOCUMENTATION/DeveloperTools/gcc-4.0.1/gcc/Attribute-Syntax.html#Attribute-Syntax

At any rate, please do more investigation.  If this is the right thing to do, we'll do it, but until we have a clear idea what on earth gcc is doing here, I'd rather hold off.

John.



More information about the cfe-commits mailing list