From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,e95e8407f65e1cfb X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-06-19 12:37:47 PST Newsgroups: comp.lang.ada Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!feed2.news.rcn.net!rcn!nntp.abs.net!uunet!dca.uu.net!ash.uu.net!world!news From: Robert A Duff Subject: Re: Look what I caught! was re:Ada paper critic Sender: news@world.std.com (Mr Usenet Himself) Message-ID: Date: Wed, 19 Jun 2002 19:37:02 GMT References: <3d0e5750_2@news.bluewin.ch> <3d0fb5eb_3@news.bluewin.ch> <3D10952F.17A62CCF@despammed.com> NNTP-Posting-Host: shell01.theworld.com Organization: The World Public Access UNIX, Brookline, MA X-Newsreader: Gnus v5.7/Emacs 20.7 Xref: archiver1.google.com comp.lang.ada:26429 Date: 2002-06-19T19:37:02+00:00 List-Id: Wes Groleau writes: > > > A C array does not contain > > >"one element more" on either side. The standard allows setting > > >a pointer to the next element after the end of an array, but > > >such a pointer can not be dereferenced. > > The standard does? But most compilers ignore this, right? > > Or is the some other explanation why it's so @#$%@#$% easy > to get a segmentation fault in C ? I think the statement that the standard "can not be dereferenced" is correct, if you interpret it to mean "any program that does so does not conform to the C standard". The reason it's "so @#$%@#$% easy..." is that the C standard does not require compilers to detect programs that violate the C standard in this way (and many other ways). The Fortran and Pascal standards take the same attitude: compilers are not required to detect non-conforming programs. The Ada standard of course requires such detection in most cases, which is a huge advantage of Ada. - Bob