size_t

R. Vuurboom roelof at idca.tds.PHILIPS.nl
Thu Jul 13 04:33:23 AEST 1989


In article <1062 at cbnewsl.ATT.COM> dfp at cbnewsl.ATT.COM (david.f.prosser) writes:
>In article <149 at ssp1.idca.tds.philips.nl> roelof at idca.tds.PHILIPS.nl (R. Vuurboom) writes:
> [Interesting and intricate argument why calloc(1000,1000) could even
>  dump its core on the floor]

phew!

>calloc(1000,1000) occurs.  Moreover, as the argument hinges on the less than
>strictly conforming nature of the call, and since everything except the
>result of the multiplication is strictly conforming, the argument may well
>be tenuous.  I, nevertheless, am sticking by my guns.

Well...as long as you don't shoot yourself in the foot :-)

I think your train of argument is (formally) correct.
I agree with Doug Gwyn however that allowing the calloc to fail to ensure
that a _possible_ sizeof call will succeed seems to be putting the cart
before the horse. It makes more sense to me to just define nonconformant
behaviour for sizeof for objects larger than size_t can handle.

>
>Dave Prosser	...not an official X3J11 answer... (of course)

Of course :-)



More information about the Comp.std.c mailing list