xproto: _X_NONNULL uses GNU extension

Alan Coopersmith alan.coopersmith at oracle.com
Mon Jan 12 18:25:41 PST 2015


On 01/10/15 03:41 PM, Thomas Klausner wrote:
> On Fri, Jan 09, 2015 at 03:26:24PM -0800, Alan Coopersmith wrote:
>> On 01/ 9/15 02:53 PM, Thomas Klausner wrote:
>>> Hi!
>>>
>>> When compiling slock with clang, one sees:
>>>
>>> /scratch/x11/slock/work/.buildlink/include/X11/Xfuncproto.h:157:24: warning: named variadic macros are a GNU extension [-Wvariadic-macros]
>>> #define _X_NONNULL(args...)  __attribute__((nonnull(args)))
>>>
>>> Is there a way to define this without using GNU extensions?
>>
>> You could use C99 varargs macros like the non-#if __GNUC__ case does,
>> we just never bothered making the __GNUC__ version portable to non-gcc
>> compilers, since why lie and say you're gcc compatible if you're not?
>
> I think the idea is that in wide areas clang really is gcc-compatible,
> but prefers to follow C99 or C++11 if it conflicts.
>
> Would the attached patch be acceptable? That at least removes the
> warning for clang for me.

Works for me.

Reviewed-by: Alan Coopersmith <alan.coopersmith at oracle.com>

-- 
	-Alan Coopersmith-              alan.coopersmith at oracle.com
	 Oracle Solaris Engineering - http://blogs.oracle.com/alanc


More information about the xorg-devel mailing list