void casts; and C definition question

Guy Harris guy at rlgvax.UUCP
Mon Oct 3 23:14:57 AEST 1983


The language should *not* guarantee that calling a function without having
properly declared the type of the function's return value should work, because
not all implementations can guarantee this.  If pointers and "int"s are
different sizes (as they are on several 68000 implementations, on Zilog's
segmented Z8000 implementation (I assume), and probably on several other
machines with a decently-sized address space but either weak support for
32-bit integers (like the 68K with its lack of 32-bit mul/div) or performance
losses for 32-bit integers) if you don't say "char *malloc()" or whatever
you are *guaranteed* to lose.  Programs which depend on this working should
either be changed not to or be hacked on such implementations to use "long"s
instead of "int"s.

	Guy Harris
	{seismo,mcnc,we13,brl-bmd,allegra}!rlgvax!guy



More information about the Comp.lang.c mailing list