Article View: comp.std.c
Article #1810bounds checking (was: X3J11 Pleasanton meeting summary)
From: Karl Heuer
Date: Mon, 08 Oct 1990 19:18
Date: Mon, 08 Oct 1990 19:18
20 lines
1585 bytes
1585 bytes
In article <14049@smoke.BRL.MIL> gwyn@smoke.BRL.MIL (Doug Gwyn) writes: > int a[4][5]; > a[1][7] = 0; /* undefined behavior */ >[justification for the above] I presume that this ruling (if upheld) also means that strictly conforming programs may not use extensible structs via the usual overmalloc hack? >What is missing in the standard that would be required for such punning >to be strictly conforming is some sort of guarantee that an array of >arrays of T is also in some contexts considered an array of T itself. I believe X3J11 has previously stated that "objects are composed of bytes" means that any object may be considered an array of char. If this continues to be true, and yet the above example is illegal, then there's a bunch of intermediate cases that have questionable legality. I posted an article about this (my "proof" that extensible structs are legal) on or around 20-Dec-1989, I think. Anyone still have a copy? Karl W. Z. Heuer (karl@kelp.ima.isc.com or ima!kelp!karl), The Walking Lint
Technical Details
Message-ID:
<18456@haddock.ima.isc.com>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!asuvax!ncar!ico!haddock!karlReferences:
<13996@smoke.BRL.MIL> <1990Oct3.184359.2348@sq.sq.com> <1737:Oct803:02:5890@kramden.acf.nyu.edu> <14049@smoke.BRL.MIL>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!asuvax!ncar!ico!haddock!karl From: karl@haddock.ima.isc.com (Karl Heuer) Newsgroups: comp.std.c Subject: bounds checking (was: X3J11 Pleasanton meeting summary) Message-ID: <18456@haddock.ima.isc.com> Date: 8 Oct 90 19:18:21 GMT References: <13996@smoke.BRL.MIL> <1990Oct3.184359.2348@sq.sq.com> <1737:Oct803:02:5890@kramden.acf.nyu.edu> <14049@smoke.BRL.MIL> Reply-To: karl@kelp.ima.isc.com (Karl Heuer) Organization: Interactive Systems, Cambridge, MA 02138-5302 Lines: 20