From owner-freebsd-arch Thu Aug 16 23:33:19 2001 Delivered-To: freebsd-arch@freebsd.org Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by hub.freebsd.org (Postfix) with ESMTP id 2662637B40C for ; Thu, 16 Aug 2001 23:33:13 -0700 (PDT) (envelope-from bde@zeta.org.au) Received: from bde.zeta.org.au (bde.zeta.org.au [203.2.228.102]) by mailman.zeta.org.au (8.9.3/8.8.7) with ESMTP id QAA22232; Fri, 17 Aug 2001 16:31:38 +1000 Date: Fri, 17 Aug 2001 16:31:36 +1000 (EST) From: Bruce Evans X-X-Sender: To: Mark Murray Cc: Subject: Re: Style 9 nitpicking question In-Reply-To: <200108161551.f7GFpLK72129@grimreaper.grondar.za> Message-ID: <20010817162340.O34503-100000@besplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Thu, 16 Aug 2001, Mark Murray wrote: > > > Questions: > > > > > > 1) That "(void)" is useless by any metric that I am able to determine > > > (WARNS=2, BDECFLAGS etc), and gets in the way of linting. Is there > > > any reason to continue to advocate its use by this example? There > > > is no other reference to "voiding-out" of return values. > > > > It by prevents warnings like the following from `lint -h': > > > > "snprintf returns a value which is sometimes ignored" > > "snprintf returns a value which is always ignored" > > Hmm - in the linting that I have done, I've told lint that ignoring > the return value of ${THESE} functions is OK. > > (THESE = str* *printf, *scanf and a few others) Ignoring the result of *printf is not always OK, and ignoring the result of *scanf is almost never OK. > > This is the opposite of getting in the way of linting. > > Sorta :-) Its often not a useful warning (most particularly for > certain functions), and the (void) cast offends me because it is > useless and obfuscating. I don't like it much either, but it's normal practice in BSD code. Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message