FAQ - malloc array - clarify

Karl Heuer karl at haddock.ima.isc.com
Sat Sep 15 09:41:00 AEST 1990


In article <15495 at drilex.UUCP> dricejb at drilex.UUCP (Craig Jackson drilex1) writes:
>People here have been blathering on about broken compilers, erroneous lint
>libraries, etc, thinking that 'sizeof()' is returning an int on that machine.
>
>Wouldn't a more reasonable explanation be that 'ncols' is an int, and that
>particular compiler treats 'int * unsigned' as 'int' (or 'long int')?  

There is a well-known implementation where sizeof() returns a signed int.
(Understandable, since K&R 1 didn't say.)  I've never heard of one that thinks
int*uint is signed.  (Which would be harder to defend, since both Classic and
ANSI C agree that it isn't.)

Karl W. Z. Heuer (karl at kelp.ima.isc.com or ima!kelp!karl), The Walking Lint



More information about the Comp.lang.c mailing list