------- Comment #40 from rguenth at gcc dot gnu dot org  2010-08-11 22:48 
-------
(In reply to comment #39)
> (In reply to comment #37)
> > Btw, 6.5.6/7 "For the purposes of these operators, a pointer to an object 
> > that
> > is
> > not an element of an array behaves the same as a pointer to the first 
> > element
> > of an array of length one with the type of the object as its element type."
> 
> No problem, as long as it doesn't make a copy.

Why do you think GCC makes it the address of a copy?

> I clearly stated this, and
> explained with C99, that even 1-entry arrays can be navigated beyond the
> boundaries. I thoroughly explained the arithmetic. Where did you read that
> 1-entry arrays can be copied to a different location when someone requests the
> address operator?

You are wrong here.  The next paragraph, 6.5.6/8, explains that,
"... otherwise the behavior is undefined.  If the result points one past
the last element of the array object, it shall not be used as the operator
of a unary * operator that is evaluated.".  Where I point you to
6.5.3.2/3 if you now claim that x[2] isn't invoking the unary * operator.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45249

Reply via email to