This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Should GCC publish a general rule/warning due to it's default presumption of undefined signed integer overflow semantics?
- From: Gabriel Dos Reis <gdr at integrable-solutions dot net>
- To: Andrew Pinski <pinskia at physics dot uc dot edu>
- Cc: "'gcc mailing list'" <gcc at gcc dot gnu dot org>
- Date: 01 Jul 2005 03:22:42 +0200
- Subject: Re: Should GCC publish a general rule/warning due to it's default presumption of undefined signed integer overflow semantics?
- References: <BEE9BCEE.AAC7%schlie@comcast.net><20050630220250.GA10768@synopsys.com><m3wtobwkg9.fsf@uniton.integrable-solutions.net><20050630232531.GA11010@synopsys.com><m3irzv5p1r.fsf@uniton.integrable-solutions.net><a0222ee0d8b9c032e23bc30d2920559b@physics.uc.edu>
Andrew Pinski <pinskia@physics.uc.edu> writes:
| On Jun 30, 2005, at 8:48 PM, Gabriel Dos Reis wrote:
|
| > | Really? You've talked to Stroustrup?
| >
| > I work with him on daily basis, and as a matter of fact we've discussed
| > the heart of this topic of this thread yesterday over lunch. But, as
| > much as I hate argument by authority I could not let this discussion
| > goes on the slope it is taking without saying what I understood from
| > discussion with him on the topic. It wasn't meant as a proof. Just a
| > data point. Of course, it is far preferable he speaks for himself but
| > it is hard to have him take part of a debate where extreme abstract
| > arguments are more dominant than balance between two apparant
| > conflicting goals. And that is, I guess, a wise thing to do just as
| > core developers like RTH may have a say on this very issue :-)
|
| But the reason question is why make it an undefined behavior instead of
| an implementation defined?
I cannot tell you exactly why it was made undefined behaviour. But,
I can tell you from experience working in the C++ committee that there
may be various reasons why something is left undefined (including
oversight), not just because the committee thought it would be fun.
In this specific case, I think (but I'm not 100% sure) it is a carry
over from C90 (like many other "curious" cases).
-- Gaby