Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site wjh12.UUCP Path: utzoo!linus!vaxine!wjh12!kendall From: kendall@wjh12.UUCP (Sam Kendall) Newsgroups: net.lang.c Subject: Re: void avoidance Message-ID: <331@wjh12.UUCP> Date: Sun, 9-Oct-83 10:59:19 EDT Article-I.D.: wjh12.331 Posted: Sun Oct 9 10:59:19 1983 Date-Received: Mon, 10-Oct-83 10:56:28 EDT References: <5927@watmath.UUCP> Organization: Delft Consulting Corp., New York Lines: 23 Damon, what is your objection to void casts? If your objection is that int f(); ... (void) f(); is redundant, since the void cast specifies something ("throw away the result") which would be apparent anyway, you are right, in that void casts are no help to compilers. They are useful for lint. A void cast says to lint, "I'm not using the value of this expression, and I'm well aware of it, so shut up." As for `(void) ++i', there is nothing wrong with it, but lint chooses not to complain about throwing away the value of an assignment operator (including ++ and --) anyway, so the void cast serves no purpose. There are rules about void specified in later versions of the C Reference Manual; unfortunately Prentice-Hall still publishes the original. (I think there are some bad decisions in those rules, but that is another story.) Sam Kendall {allegra,ihnp4}!wjh12!kendall Delft Consulting Corp. decvax!genrad!wjh12!kendall