PATCH] OS: Add some noreturn and printf compiler attributes where appropriate

Jeremy Huddleston jeremyhu at freedesktop.org
Sat Mar 27 19:45:26 PDT 2010


On Mar 27, 2010, at 18:39, Alan Coopersmith wrote:
> 
>> +/* XXX Need to check which GCC versions have the format(printf) attribute. */
>> +#if defined(__GNUC__) && (__GNUC__ > 2)
>> +#define _printf_attribute(a,b) __attribute((format(__printf__,a,b)))
>> +#define _noreturn_attribute __attribute((noreturn))
> 
> Why not just use _X_ATTRIBUTE_PRINTF from X11/Xfuncproto.h ?
> Unfortunately there's no noreturn there, but we could add it.
> 
> (Obviously I'm biased towards having one place to update as the
> Sun compilers are growing __attribute compatibility for various
> of the attributes in new releases.)

I would rather have one location as well.  I just did it in os.h since it was already there (I just moved it up from below).

I sent a patch for x11proto that makes that change and will hold on this until that one hits a release.

--Jeremy



-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 3333 bytes
Desc: not available
URL: <http://lists.x.org/archives/xorg-devel/attachments/20100327/9704bb69/attachment.bin>


More information about the xorg-devel mailing list