This is the mail archive of the
mailing list for the GCC project.
Re: Autoconf manual's coverage of signed integer overflow & portability
- From: Andrew Pinski <pinskia at physics dot uc dot edu>
- To: eggert at CS dot UCLA dot EDU (Paul Eggert)
- Cc: gcc at gcc dot gnu dot org, autoconf-patches at gnu dot org, bug-gnulib at gnu dot org, autoconf at gnu dot org, bug-autoconf at gnu dot org
- Date: Tue, 2 Jan 2007 19:01:03 -0500 (EST)
- Subject: Re: Autoconf manual's coverage of signed integer overflow & portability
> Today I updated the Autoconf manual to contain the following
> description of the current situation with signed integer overflow.
> This section of the manual is intended to advise programmers what to
> do about portable C programs in this area.
> I think some discussion along these lines also belongs in the GCC
> manual. As I understand it, though, some of the GCC developers are
> loath to make any promises about GCC's behavior on signed overflow, so
> the exact wording might be controversial.
> Eventually I'd like to add better support for -fwrapv and the like to
> Autoconf, but that can wait for further thought and experimentation.
> Comments are welcome of course.
Really this should be documented in the C books people learn from. This
problem is that those books don't talk about these undefined behavior at
all. Aliasing has the same issue. So does sequence points. New code
should not be punished because the standard books that people learn from
are all broken. I can tell you most C/C++ books don't talk any undefined
behavior at all.
Also most C++ books don't talk much about namelookup in templates either
which is the other highly reported non bug to GCC.