autoconf
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Autoconf manual's coverage of signed integer overflow & portability


From: Russell Shaw
Subject: Re: Autoconf manual's coverage of signed integer overflow & portability
Date: Wed, 03 Jan 2007 18:30:49 +1100
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.0.8) Gecko/20061105 Iceape/1.0.6 (Debian-1.0.6-1)

Paul Eggert wrote:
Andrew Pinski <address@hidden> writes:

Let me make the point that signed overflow has been undefined since
before the C standard was finialized and in fact there is a nice
paper/book called "C Traps and Pitfalls[2]" which mentions all of this
back in 1988.

C Traps and Pitfalls, like K&Rv2, is derived from a draft of the C89
standard and was intended to match the final C89 standard closely.  It
is therefore not a reliable source of information about traditional C.

K&Rv1 is a better source, and as David Daney reports in
<http://gcc.gnu.org/ml/gcc/2006-12/msg00948.html>
it said that integer overflow handling was machine-dependent
and that all existing implementations ignored overflows.
This corresponds to existing practice at the time,
which was that signed overflow wrapped; but clearly
there was an attempt to allow other implementations.

Compiler writers have been trying to drag C users away from C's
traditional wrapping semantics ever since C89 came out, but they
haven't been all that succesful yet.

And replace it with what?




reply via email to

[Prev in Thread] Current Thread [Next in Thread]