This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: basic VRP min/max range overflow question
- From: Florian Weimer <fw at deneb dot enyo dot de>
- To: Paul Schlie <schlie at comcast dot net>
- Cc: "Joseph S. Myers" <joseph at codesourcery dot com>, Dale Johannesen <dalej at apple dot com>, Robert Dewar <dewar at adacore dot com>, Mike Stump <mrs at apple dot com>, Andrew Pinski <pinskia at physics dot uc dot edu>, GCC Development <gcc at gcc dot gnu dot org>
- Date: Sat, 18 Jun 2005 23:00:46 +0200
- Subject: Re: basic VRP min/max range overflow question
- References: <BED9E540.A897%schlie@comcast.net>
* Paul Schlie:
> So in effect the standard committee have chosen to allow any program which
> invokes any undefined behavior to behave arbitrarily without diagnosis?
>
> This is a good thing?
It's the way things are. There isn't a real market for
bounds-checking C compilers, for example, which offer well-defined
semantics even for completely botched pointer arithmetic and pointer
dereference.
C isn't a programming language which protects its own abstractions
(unlike Java, or certain Ada or Common Lisp subsets), and C never was
intended to work this way. Consequently, the committee was right to
deal with undefined behavior in the way it did. Otherwise, the
industry would have adopted C as we know it, and the ISO C standard
would have had the same relevance as, say, the ISO Pascal on the
evolution of Pascal.
Keep in mind that the interest in "safe" langauges (which protect
their abstractions) for commercial production code is a very, very
recent development, and I'm not sure if this is just an accident.