Subject: Re: ignoring return values from functions.
To: Curt Sampson <cjs@cynic.net>
From: James Graham <greywolf@starwolf.com>
List: tech-userlevel
Date: 09/20/2001 22:42:05
To address something earlier:

Error checking is one thing.

Pedantry is another.

(void) falls into the realm of the latter -- the only thing it makes
clear to me is that either the programmer or the compilation requirements
are pedantic to the point of being anal.  I don't hold at all that
a (void) before the call as opposed to lack of same conjoined with a lack
of a variable assignment or comparison to said call makes anything at
all clearer except that the programmer is scared that the compiler's
going to say something.  I think this "warning: function returns value
which is ignored" nonsense is poppycock.  Yes, it's ignored.  I am
ignoring it.  I don't care what comes back from it.  I'm aware, and
I should not have to tell the compiler that I'm ignoring it.  If I
wanted this, I'd go back to programming in Pascal or something.  Go away.

(void) does NOT fall into the category of meaningful error checking;
if you're error checking something, you're presumably going to write
the code to handle said error-checking!

Hell's bells, one should be able to redeclare a function as void
and not have to typecast it all over the place but NO, we can't do
THAT either, because gcc is run to be so damnably pedantic that it
will complain the prototype is redefined.

Given the choice between the two warning systems, I'd rather have my
compiler bitch at me about a redefined function prototype than about
some silly-ass (void) missing from random calls.



On Fri, 21 Sep 2001, Curt Sampson wrote:

# Date: Fri, 21 Sep 2001 14:03:17 +0900 (JST)
# From: Curt Sampson <cjs@cynic.net>
# To: NetBSD Userlevel Technical Discussion List <tech-userlevel@netbsd.org>
# Subject: Re: ignoring return values from functions.
#
# On Thu, 20 Sep 2001, Greg A. Woods wrote:
#
# > Indeed I try to explicitly fclose(stdout) before
# > exiting in any filter program that generally writes only to stdout, and
# > of course to check the error return from that close.)
#
# So if there's an error with that close, you then print the error to
# stderr? If you've used stderr at all in your program, do you always
# also attempt to close it and check the close? If that close fails,
# what do you do?
#
# Just curious.
#
# cjs
# --
# Curt Sampson  <cjs@cynic.net>   +81 3 5778 0123   http://www.netbsd.org
#     Don't you know, in this new Dark Age, we're all light.  --XTC
#
#


				--*greywolf;
--
NetBSD: Linux without the hype.