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: 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.

-- Pinski


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