bounds checking (was: X3J11 Pleasanton meeting summary)

Alan J Rosenthal flaps at dgp.toronto.edu
Wed Oct 10 00:12:44 AEST 1990


karl at haddock.ima.isc.com (Karl Heuer) writes:
>In article <14049 at smoke.BRL.MIL> gwyn at smoke.BRL.MIL (Doug Gwyn) writes:
>>	int a[4][5];
>>	a[1][7] = 0;	/* undefined behavior */
>
>I presume that this ruling (if upheld) also means that strictly conforming
>programs may not use extensible structs via the usual overmalloc hack?

Alternatively, (int (*)[5])malloc(4 * 5 * sizeof(int)) may be deemed to create
an object viewable as being 20 ints even though int a[4][5] does not, in which
case the overmalloc hack would still be fine (though blecherous).

ajr

--

"Anytime there are electronic systems there are usually complications of
electronic failure," he said.



More information about the Comp.std.c mailing list