Perhaps I worded that poorly. I know that we vould index it by 666, if we
like, but it's liable to generate a runtime error (one a machine with a MMU,
at any rate. A non-MMU processor the effects might never show up. Or you
may tell the CP/M BIOS that your disk has 10 heads instead of 2).
I was thinking "legal" as in "I'm not so stupid as to permit this to
happen."
--John
-----Original Message-----
From: owner-classiccmp(a)classiccmp.org
[mailto:owner-classiccmp@classiccmp.org]On Behalf Of Fred Cisin
(XenoSoft)
Sent: Wednesday, February 06, 2002 15:19 PM
To: classiccmp(a)classiccmp.org
Subject: RE: The importance of showing ALL of the code in C
On Wed, 6 Feb 2002, John Chris Wren wrote:
Or it would possibly cause a segfault, since A
can only be
legally indexed
by 0..9. (This is assuming it didn't get
optimized out).
No. In C, that is actually NOT considered an error by the language! It's
"bad form", but permitted by the language to use array notation to access
memory locations that were NOT allocated to the array!
And yes, seeing all the code is important.
Otherwise, it's
just pure
speculation.