[prev in list] [next in list] [prev in thread] [next in thread] 

List:       freedesktop-xorg-devel
Subject:    xserver: Branch 'master' - 15 commits
From:       tom () dbservice ! com (Tomas Carnecky)
Date:       2009-03-17 18:37:17
Message-ID: F025B489-78B9-4093-8B6C-384BAE97E15B () dbservice ! com
[Download RAW message or body]


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


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic