void avoidance

Damon Permezel dapermezel at watmath.UUCP
Sun Oct 9 04:43:19 AEST 1983


	the construct

		(coid) f()

	is not meaningless at all.  

I didn't say it was meaningless. I said it was as devoid of meaning as
(void) ++i.

	....  The complex statement
	given in the initial flame means something entirely different -
	that being the call of a (void)-declared function f() that was
	not declared locally.

Au contrair. It does not say that 'f' was declared to be type void elsewhere.
It casts 'f' to be a pointer to a function that returns nothing. 'f' could
indeed return char *.



I have never seen any rules for type cast with void types. I suspect that
the present behaviour just 'came out in the wash' with many compilers.
Sure, they allow

	(void) f();

but they also allow

	(void) ++i; and (void) 1;	/* PCC does, at least */

This is not very useful.

=damon



More information about the Comp.lang.c mailing list