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]
Other format: [Raw text]

Re: changing "configure" to default to "gcc -g -O2 -fwrapv ..."


On 2006-12-31 09:27:21 -0500, Robert Dewar wrote:
> As I said earlier in this thread, people seem to think that the
> standards committee invented something new here in making overflow
> undefined, but I don't think that's the case. I personally would
> have thought it more judicious to make it implementation defined,
> since I don't like undefined semantics anywhere in programming
> languages unless a hugely strong case can be made that providing
> or requiring a definition damages code (e.g. uninitialized variables
> have always been generally agreed to be in that class for C/Ada/Fortran
> level languages, but even there Ada 95 greatly reduced the damage
> that uninitialized variables can do, and introduced the notion of
> bounded error to replace many undefined (called erroneous) cases
> in Ada).

The compiler could have an optional mode where everything is defined.
So, this is more a problem with the compiler than with the language.
But this won't prevent from having bugs, possibly difficult to detect,
in particular if behavior is implementation-defined instead of being
fixed for every implementation.

-- 
Vincent Lefèvre <vincent@vinc17.org> - Web: <http://www.vinc17.org/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.org/blog/>
Work: CR INRIA - computer arithmetic / Arenaire project (LIP, ENS-Lyon)


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