casts to (void)

geacc022%timevx at CIT-HAMLET.ARPA geacc022%timevx at CIT-HAMLET.ARPA
Fri Jul 19 19:54:53 AEST 1985


    Why should a cast to (void) be necessary in a statement like

	(void) printf("foo\n");

?  Why not say that the expression in the definition
<statement> = <expression>";" is automatically cast to type void?

    I put the casts to void in because they keep lint happy, but I'll
be the first to say they look ugly and impair readability...and why
are they really necessary, anyway?

			Gary Ansok
			GEACC022%TIMEVX @ CIT-HAMLET.ARPA
			GEA @ CALTECH.BITNET
			...ucbvax!cithep!timevx#geacc022

"All the world loves a straight man."



More information about the Comp.lang.c mailing list