On Dec 8, 2009, at 7:29 AM, Jamey Sharp wrote:

> On Mon, Dec 7, 2009 at 9:55 PM, Tomas Carnecky <[email protected]> wrote:
>> [1] http://78.46.209.101/stuff/clang-static-analyzer/fdo/
> 
> Looking at the libX11 output: What kind of annotation do you need to
> express that _XIOError can't ever return? Either it'll call exit(2) or
> an application will longjmp from it all the way out of Xlib code
> paths. Will clang accept GCC's __attribute__((noreturn))? That should
> eliminate both "Dereference of null pointer" false positive reports in
> XlibInt.c, at least.

That's what I thought about, too :) And indeed adding that attribute 'fixes' 
the two reported issues in XlibInt.c. It would be best though to add such 
define to x11proto/Xfuncproto.h, so it's available in all modules.

Btw, what is the earliest gcc version that X claims to support? 
attribute((noreturn)) has been supported since gcc 2.5, so I'm tempted to 
simply add #if defined(__GCC__) and not check the gcc version. Would that be 
acceptable?

Also, even though there is _X_INLINE, the xserver source uses plain 'inline' in 
many places and nobody complained yet, so I guess everybody is using a compiler 
that understands the keyword (which would mean everybody uses gcc 3.0.3 or 
later).

tom
_______________________________________________
xorg-devel mailing list
[email protected]
http://lists.x.org/mailman/listinfo/xorg-devel

Reply via email to