From owner-cvs-all@FreeBSD.ORG Mon Apr 2 07:32:48 2007 Return-Path: X-Original-To: cvs-all@freebsd.org Delivered-To: cvs-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D2DB716A401; Mon, 2 Apr 2007 07:32:48 +0000 (UTC) (envelope-from alexander@leidinger.net) Received: from redbull.bpaserver.net (redbullneu.bpaserver.net [213.198.78.217]) by mx1.freebsd.org (Postfix) with ESMTP id 5BE6913C45E; Mon, 2 Apr 2007 07:32:48 +0000 (UTC) (envelope-from alexander@leidinger.net) Received: from outgoing.leidinger.net (p54A5EF85.dip.t-dialin.net [84.165.239.133]) by redbull.bpaserver.net (Postfix) with ESMTP id A55C02E206; Mon, 2 Apr 2007 09:32:41 +0200 (CEST) Received: from webmail.leidinger.net (webmail.Leidinger.net [192.168.1.102]) by outgoing.leidinger.net (Postfix) with ESMTP id BDAD45B4817; Mon, 2 Apr 2007 09:32:38 +0200 (CEST) Received: (from www@localhost) by webmail.leidinger.net (8.13.8/8.13.8/Submit) id l327Wc9p060588; Mon, 2 Apr 2007 09:32:38 +0200 (CEST) (envelope-from Alexander@Leidinger.net) Received: from pslux.cec.eu.int (pslux.cec.eu.int [158.169.9.14]) by webmail.leidinger.net (Horde MIME library) with HTTP; Mon, 02 Apr 2007 09:32:38 +0200 Message-ID: <20070402093238.dmw2rypu40sksc0o@webmail.leidinger.net> X-Priority: 3 (Normal) Date: Mon, 02 Apr 2007 09:32:38 +0200 From: Alexander Leidinger To: "Greg 'groggy' Lehey" References: <200703282125.l2SLPuR9058727@repoman.freebsd.org> <20070329012834.GC79742@wantadilla.lemis.com> <20070329015212.GA97061@heff.fud.org.nz> <20070329133631.e0xqnpftccgc4cow@webmail.leidinger.net> <20070402042600.GB19923@wantadilla.lemis.com> In-Reply-To: <20070402042600.GB19923@wantadilla.lemis.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; DelSp="Yes"; format="flowed" Content-Disposition: inline Content-Transfer-Encoding: quoted-printable User-Agent: Internet Messaging Program (IMP) H3 (4.1.3) / FreeBSD-7.0 X-BPAnet-MailScanner-Information: Please contact the ISP for more information X-BPAnet-MailScanner: Found to be clean X-BPAnet-MailScanner-SpamCheck: not spam, SpamAssassin (not cached, score=-14.864, required 8, autolearn=not spam, BAYES_00 -15.00, DK_POLICY_SIGNSOME 0.00, FORGED_RCVD_HELO 0.14) X-BPAnet-MailScanner-From: alexander@leidinger.net X-Spam-Status: No Cc: cvs-src@FreeBSD.org, src-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: Giving in to Coverity (was: cvs commit: src/sys/netgraph/bluetooth/l2cap ng_l2cap_cmds.c) X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Apr 2007 07:32:48 -0000 Quoting Greg 'groggy' Lehey (from Mon, 2 Apr 2007 =20 13:56:00 +0930): > On Thursday, 29 March 2007 at 13:36:31 +0200, Alexander Leidinger wrote: >> Quoting Andrew Thompson (from Thu, 29 Mar 2007 >> 13:52:12 +1200): >> >>> On Thu, Mar 29, 2007 at 10:58:34AM +0930, Greg 'groggy' Lehey wrote: >>>> On Wednesday, 28 March 2007 at 21:25:56 +0000, Maksim Yevmenkin wrote: >>>>> emax 2007-03-28 21:25:56 UTC >>>>> >>>>> FreeBSD src repository >>>>> >>>>> Modified files: >>>>> sys/netgraph/bluetooth/l2cap ng_l2cap_cmds.c >>>>> Log: >>>>> Try to silence Coverity by adding (void) in front of function call. >>>>> Also add a comment, explaining why return value is not being checked= . >>>> >>>> I hope Coverity isn't going to force us to add unnecessary casts to >>>> function calls. >>> >>> Well no, you can always silence Coverity by just marking it as a false >>> bug. >> >> Maxim and me discussed this briefly before this commit. >> >> ... >> >> The cast does not obfuscate the code, doesn't make it harder to read ... > > I've dropped the rest of your argumentation, because I don't disagree > with it, but I do think that unnecessary casts cause (minor) > obfuscation and make it (fractionally) more difficult to read. > > My concern is that we shouldn't compromise our style because of bugs > in program checkers. I understand that there are alternatives, like > flagging it for Coverity as "OK", and I'd expect that to be the > preferable solution. But I'm not the guardian of style, so I'll let > others decide on this if they care. There are several cases where Coverity gets something wrong (e.g. the =20 use of TAILQ). I did mark those as invalid in Coverity (until either =20 we get a new version of Coverity which understands this, or someone =20 writes a model of the TAILQ stuff for Coverity, or until someone tells =20 me to mark them as false positives). I did this because I don't know =20 how to fix this in our code _and_ I see no benefit in fixing this in =20 our code just to make Coverity not moan. For the void cast we are =20 talking about I see a benefit. Coverity can count this as "the return =20 value of this function is checked". As such a report is only generated =20 if a specific percentage of the use of a function is handled this way, =20 it is important if we want to get reports for this. And we want to get =20 reports for functions where the return value typically has to be =20 checked. Bye, Alexander. --=20 Marriage is learning about women the hard way. http://www.Leidinger.net Alexander @ Leidinger.net: PGP ID =3D B0063FE7 http://www.FreeBSD.org netchild @ FreeBSD.org : PGP ID =3D 72077137