From: Wes Groleau <wesgroleau@despammed.com>
Subject: Re: Look what I caught! was re:Ada paper critic
Date: Wed, 19 Jun 2002 12:48:21 -0500
Date: 2002-06-19T12:48:21-05:00 [thread overview]
Message-ID: <3D10C3E5.7FA3360C@despammed.com> (raw)
In-Reply-To: 3D10B886.9507CC32@san.rr.com
> > > >"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?
>
> The pointer can be dereferenced, of course, but it's "undefined behavior".
> Actually, what the C standard says is that if you have a pointer just after
> the end of an array, then the result of dereferencing that pointer is
> "unpredictable". Such dereferences can cause segmentation fault, trash some
That's what I thought. The original claim was in error.
The correct statement is "such a pointer should not be dereferenced"
--
Wes Groleau
http://freepages.rootsweb.com/~wgroleau
next prev parent reply other threads:[~2002-06-19 17:48 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 [this message]
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
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