xserver: Branch 'master' - 15 commits

Tomas Carnecky tom at dbservice.com
Tue Mar 17 11:37:17 PDT 2009


On Mar 17, 2009, at 6:58 PM, Adam Jackson wrote:

> On Mon, 2009-03-16 at 08:42 -0700, Alan Coopersmith wrote:
>> The casts of function returns to (void) were typically to silence
>> warnings from lint and similar source checkers that you were ignoring
>> the return values from the function, and really should be doing some
>> error checking there.   Not sure if those warnings are issued by
>> any of the source checkers currently used other than lint (gcc -Wall,
>> sparse, and Coverity are the other three I know of in use).
>
> gcc will only issue warnings for these cases for functions declared  
> with
> __attribute__((warn_unused_result)).  A handful of libc functions  
> are so
> marked.

And in that case a simple (void) won't shut up gcc. You have to create  
a local variable and assign the return value to it. That'll shut up  
gcc, but probably cause warnings in other analyzers ('local variable  
assigned but never read' or something like that).

tom



More information about the xorg-devel mailing list