This is the mail archive of the
mailing list for the GCC project.
Re: Is this a gcc bug?
- To: gcc at gcc dot gnu dot org
- Subject: Re: Is this a gcc bug?
- From: Axel Kittenberger <Anshil at gmx dot net>
- Date: Thu, 18 Jan 2001 08:29:56 +0100 (MET)
Falk Hueffner wrote:
> > Michael Eager <email@example.com> writes:
> > > My sugguestion:
> > >
> > > undefined behavior: value of expression using 'x' is undefined
> > This would seem to imply that the behaviour is undefined because one
> > uses an undefined value. But that's not the case: the standard says
> > program behaviour is undefined even if you say x = ++x and never look
> > at x again. (At least IIRC.)
> It is the result of the expression (including any side effects) which is
> undefined. An expression has a value, even if you never use it.
> There are many constructs with undefined behavior. Some can be
> recognized at compile time; most cannot.
How about the compile-error:
"detected undefined behaviour: [some actual explanation]"?
..if gcc is able to see it in this case?
Sent through GMX FreeMail - http://www.gmx.net