comp.lang.ada
 help / color / mirror / Atom feed
From: Robert A Duff <bobduff@shell01.TheWorld.com>
Subject: Re: Look what I caught! was re:Ada paper critic
Date: Wed, 19 Jun 2002 19:37:02 GMT
Date: 2002-06-19T19:37:02+00:00	[thread overview]
Message-ID: <wcc4rfz5ach.fsf@shell01.TheWorld.com> (raw)
In-Reply-To: 3D10952F.17A62CCF@despammed.com

Wes Groleau <wesgroleau@despammed.com> 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



  parent reply	other threads:[~2002-06-19 19:37 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-06-17 17:35 Look what I caught! was re:Ada paper critic Alderson, Paul A.
2002-06-17 18:31 ` Darren New
2002-06-17 21:40 ` Vinzent Hoefler
2002-06-17 23:14   ` Darren New
2002-06-18 14:49     ` Hyman Rosen
2002-06-18 22:36     ` Vinzent Hoefler
2002-06-18 13:28   ` Marin David Condic
2002-06-24 19:17     ` Vinzent Hoefler
2002-06-18 19:16   ` Kevin Cline
2002-06-18 22:36     ` Vinzent Hoefler
2002-06-19 14:29       ` Wes Groleau
2002-06-19 16:59         ` Darren New
2002-06-19 17:48           ` Wes Groleau
2002-06-19 17:56             ` Darren New
2002-06-19 17:11         ` Frank J. Lhota
2002-06-19 19:31           ` Robert A Duff
2002-06-19 20:02             ` Hyman Rosen
2002-09-24 15:23               ` Matthew Heaney
2002-06-19 19:37         ` Robert A Duff [this message]
2002-06-19 13:52 ` Ted Dennison
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox