From owner-cvs-all@FreeBSD.ORG Mon Apr 2 04:26:02 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 ADF1416A407; Mon, 2 Apr 2007 04:26:02 +0000 (UTC) (envelope-from grog@lemis.com) Received: from ozlabs.org (ozlabs.org [203.10.76.45]) by mx1.freebsd.org (Postfix) with ESMTP id 4034013C45B; Mon, 2 Apr 2007 04:26:02 +0000 (UTC) (envelope-from grog@lemis.com) Received: from wantadilla.lemis.com (wantadilla.lemis.com [192.109.197.135]) by ozlabs.org (Postfix) with ESMTP id 7F7F6DDEFC; Mon, 2 Apr 2007 14:26:00 +1000 (EST) Received: by wantadilla.lemis.com (Postfix, from userid 1004) id 4974B1A9C96; Mon, 2 Apr 2007 13:56:00 +0930 (CST) Date: Mon, 2 Apr 2007 13:56:00 +0930 From: Greg 'groggy' Lehey To: Alexander Leidinger Message-ID: <20070402042600.GB19923@wantadilla.lemis.com> References: <200703282125.l2SLPuR9058727@repoman.freebsd.org> <20070329012834.GC79742@wantadilla.lemis.com> <20070329015212.GA97061@heff.fud.org.nz> <20070329133631.e0xqnpftccgc4cow@webmail.leidinger.net> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="qlTNgmc+xy1dBmNv" Content-Disposition: inline In-Reply-To: <20070329133631.e0xqnpftccgc4cow@webmail.leidinger.net> User-Agent: Mutt/1.4.2.1i Organization: The FreeBSD Project Phone: +61-8-8388-8286 Fax: +61-8-8388-8725 Mobile: +61-418-838-708 VoIP: sip:0871270137@sip.internode.on.net WWW-Home-Page: http://www.FreeBSD.org/ X-PGP-Fingerprint: 9A1B 8202 BCCE B846 F92F 09AC 22E6 F290 507A 4223 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 04:26:02 -0000 --qlTNgmc+xy1dBmNv Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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. True story: the use of parentheses around a return value is because it used to be required by an old version of the C compiler. When was the compiler problem resolved? About January 1973. But the parentheses are still there, even enshrined in style(9), because our grandfathers did it that way. Greg -- See complete headers for address and phone numbers. --qlTNgmc+xy1dBmNv Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.3 (FreeBSD) iD8DBQFGEIXYIubykFB6QiMRAnx4AJ9glGsDEAJXVroIAbzBDj5yT8d+mQCfUMR7 lY8Q+Y1rfzVTqPH2HnRUaTM= =QU+Y -----END PGP SIGNATURE----- --qlTNgmc+xy1dBmNv--