On Fri, Aug 14, 2009 at 3:12 PM, Ted Kremenek<[email protected]> wrote:
> Unless I'm mistaken, this breaks constructs like the following:
> __attribute((malloc)) void *(*f)();
>
> -Eli
>
> I implemented handling of this case, but I noticed that GCC actually rejects
> attribute 'malloc' being applied to function pointers ("warning: 'malloc'
> attribute ignored").  Should we do the same in Clang?  For function
> pointers, the malloc attribute really a property of the pointer type, not
> the declaration, but apparently GCC doesn't even reason about that.

I think it's better to be self-consistent here over being consistent
with gcc, as long as we don't break compatibility.  Function
attributes are confusing enough without making different attributes
act differently.

-Eli

_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to