This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Is this a gcc bug?


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>

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]