Giving in to Coverity (was: cvs commit: src/sys/netgraph/bluetooth/l2cap ng_l2cap_cmds.c)

Alfred Perlstein alfred at freebsd.org
Mon Apr 2 18:10:08 UTC 2007


* John Baldwin <jhb at freebsd.org> [070402 05:30] wrote:
> > There are several cases where Coverity gets something wrong (e.g. the  
> > use of TAILQ). I did mark those as invalid in Coverity (until either  
> > we get a new version of Coverity which understands this, or someone  
> > writes a model of the TAILQ stuff for Coverity, or until someone tells  
> > me to mark them as false positives). I did this because I don't know  
> > how to fix this in our code _and_ I see no benefit in fixing this in  
> > our code just to make Coverity not moan. For the void cast we are  
> > talking about I see a benefit. Coverity can count this as "the return  
> > value of this function is checked". As such a report is only generated  
> > if a specific percentage of the use of a function is handled this way,  
> > it is important if we want to get reports for this. And we want to get  
> > reports for functions where the return value typically has to be  
> > checked.
> 
> There is previous history of casting a function's return value to (void) to 
> please lint(1).  Just look for '(void)printf' :)  Coverity at least is 
> smarter than lint as it doesn't warn about printf not being checked.

I always found the (void)intfunction() stuff in code to be particulary
exciting.

-- 
- Alfred Perlstein


More information about the cvs-all mailing list