From owner-cvs-all@FreeBSD.ORG Thu Mar 29 11:36:38 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 E9D7216A403; Thu, 29 Mar 2007 11:36:38 +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 77D9F13C459; Thu, 29 Mar 2007 11:36:38 +0000 (UTC) (envelope-from alexander@leidinger.net) Received: from outgoing.leidinger.net (p54a5e7b7.dip.t-dialin.net [84.165.231.183]) by redbull.bpaserver.net (Postfix) with ESMTP id AAE762E23B; Thu, 29 Mar 2007 13:36:34 +0200 (CEST) Received: from webmail.leidinger.net (webmail.Leidinger.net [192.168.1.102]) by outgoing.leidinger.net (Postfix) with ESMTP id CF6895B4817; Thu, 29 Mar 2007 13:36:31 +0200 (CEST) Received: (from www@localhost) by webmail.leidinger.net (8.13.8/8.13.8/Submit) id l2TBaVWj023850; Thu, 29 Mar 2007 13:36:31 +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; Thu, 29 Mar 2007 13:36:31 +0200 Message-ID: <20070329133631.e0xqnpftccgc4cow@webmail.leidinger.net> X-Priority: 3 (Normal) Date: Thu, 29 Mar 2007 13:36:31 +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> In-Reply-To: <20070329015212.GA97061@heff.fud.org.nz> 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, Maksim Yevmenkin , cvs-all@FreeBSD.org, Andrew Thompson 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: Thu, 29 Mar 2007 11:36:39 -0000 Quoting Andrew Thompson (from Thu, 29 Mar 2007 =20 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 return value of the function is checked most of the time (8 out of =20 9 times in this case). The cast tells that the return value of the =20 function is ignored by intend. It is not necessary for humans to =20 understand the code, but it allows humans to gain more insight than =20 without it. The comment tells even more, so a human would not need the =20 cast, but it should allow to give statistical checkers like Coverity =20 Prevent more hints. I don't know if this version of Coverity Prevent =20 understands this hint or not (and if it isn't, I will mark this CID up =20 as IGNORE). But in the light of such "useless" comments as "/* =20 FALLTHROUGH */" to "please lint" I don't think such a comment about =20 unnecessary casts is appropriate. I don't object to add hints for =20 lint, they provide some additional info to a human being too. The cast does not obfuscate the code, doesn't make it harder to read =20 or understand and doesn't cause deeper indenting or nesting or =20 whatever. It also allows statistical checkers to count this as a =20 checked return value, so next time the return value of the same =20 function at another place is not checked, it knows about it (at least =20 theoretically, I don't know if this is the case for the version of =20 Coverity Prevent we use). If you still think this cast is a bad idea, feel free to explain why =20 this is the case in your opinion. Bye, Alexander. --=20 Someone is speaking well of you. How unusual! http://www.Leidinger.net Alexander @ Leidinger.net: PGP ID =3D B0063FE7 http://www.FreeBSD.org netchild @ FreeBSD.org : PGP ID =3D 72077137