The importance of showing ALL of the code in C

From: John Chris Wren <jcwren_at_jcwren.com>
Date: Wed Feb 6 16:02:18 2002

        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_at_classiccmp.org
> [mailto:owner-classiccmp_at_classiccmp.org]On Behalf Of Fred Cisin
> (XenoSoft)
> Sent: Wednesday, February 06, 2002 15:19 PM
> To: classiccmp_at_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.
>
>
Received on Wed Feb 06 2002 - 16:02:18 GMT

This archive was generated by hypermail 2.3.0 : Fri Oct 10 2014 - 23:34:44 BST