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

Jeremy Huddleston jeremyhu at
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.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 3333 bytes
Desc: not available
URL: <>

More information about the xorg-devel mailing list