Is this a gcc bug?

Geoff Keating geoffk@geoffk.org
Sun Jan 14 02:21:00 GMT 2001


Joern Rennecke <amylaar@cambridge.redhat.com> writes:

> > Warning: Multiple uses of 'x' in statement modifying 'x'.  Statement results
> > are implementation dependant.  Randomizer invoked to minimize predicability.
> > Attempting to reformat all Hard Drives: Failed.
> 
> The standard only talks about undefined behaviour at program run time, not
> at compile time.

The standard doesn't distinguish between 'run time' and 'compile
time'.

> Of course, you could argue that the standard doesn't forbid you to reformat
> all hard drives at compilation time, but then, you could do that irrespective
> of the input program.  I'd say that's a quality of implementation issue.

I agree.  It's better that the compiler doesn't do weird stuff, no
matter what the input---the compiler should not dump core, should not
crash your system, and should always print a helpful error message on
invalid input.  Indeed, this is a QoI issue.

-- 
- Geoffrey Keating <geoffk@geoffk.org>


More information about the Gcc mailing list