xauth warning: WRITES macro

Alan Coopersmith alan.coopersmith at oracle.com
Fri Apr 4 13:07:45 PDT 2014


On 04/ 4/14 05:35 AM, Thomas Klausner wrote:
> Hi!
>
> clang doesn't like the WRITES macro xauth uses:
>
> process.c:867:3: warning: if statement has empty body [-Wempty-body]
>                  WRITES(STDERR_FILENO, "\n");
>                  ^
> process.c:641:57: note: expanded from macro 'WRITES'
> #define WRITES(fd, S) {if(write((fd), (S), strlen((S))));}
>                                                          ^
> process.c:867:3: note: put the semicolon on a separate line to silence this warning
> process.c:641:57: note: expanded from macro 'WRITES'
> #define WRITES(fd, S) {if(write((fd), (S), strlen((S))));}
>
> Why is there an empty if, anyway?

Looks like it was done to shut up a different compiler warning:

http://cgit.freedesktop.org/xorg/app/xauth/commit/?id=afeb2c22ba1f7193acf814954e66f40cfd699c17

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


More information about the xorg-devel mailing list