Article View: comp.std.c
Article #1174Re: struct hack
From: 08-Sep-1992 0914
Date: Tue, 08 Sep 1992 00:14
Date: Tue, 08 Sep 1992 00:14
27 lines
1744 bytes
1744 bytes
In article <1992Sep07.104932.20060@x.co.uk> clive@x.co.uk (Clive Feather) writes: >In article <9209040741.AA16120@enet-gw.pa.dec.com> diamond@jit081.enet.dec.com(04-Sep-1992 1639) writes: >> You can't go past the end of an array object. But if malloc() or some other >> variable has defined the end of the actual array object, then the + operator >> can get you that far, regardless of the declared type that some other array >> variable had before getting flattened to a pointer. >But there is an intepretation that says that, given > int a [5][5]; >the access "a [1][6]" is illegal, because it goes past the bounds of the >array "a [1]". In other words, the declared type of the array does >restrict what can happen to a pointer derived from it. Is that an actual interpretation ruling or was that only someone's posted opinion on Usenet? The standard certainly does define [], +, and * in sufficiently unambiguous terms. If you have the actual texts of the interpretation rulings, would you please kindly post them? I am also curious as to the "officially" correct thing to do when an interpretation ruling contradicts the standard (whether correcting an error that everyone agrees was an error, or otherwise). -- Norman Diamond diamond@jit081.enet.dec.com If this were the company's opinion, I wouldn't be allowed to post it. "Yeah -- bad wiring. That was probably it. Very bad."
Technical Details
Message-ID:
<9209080014.AA03467@enet-gw.pa.dec.com>Path:
arc1-ca.pugleaf.net!sparky!uunet!olivea!spool.mu.edu!agate!ucbvax!jit081.enet.dec.com!diamondShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!olivea!spool.mu.edu!agate!ucbvax!jit081.enet.dec.com!diamond From: diamond@jit081.enet.dec.com (08-Sep-1992 0914) Newsgroups: comp.std.c Subject: Re: struct hack Message-ID: <9209080014.AA03467@enet-gw.pa.dec.com> Date: 8 Sep 92 00:14:51 GMT Sender: daemon@ucbvax.BERKELEY.EDU Lines: 27