]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
* doc/autoconf.texi (Integer Overflow): Mention that INT_MIN % -1
authorPaul Eggert <eggert@cs.ucla.edu>
Tue, 6 Jun 2006 01:44:53 +0000 (01:44 +0000)
committerPaul Eggert <eggert@cs.ucla.edu>
Tue, 6 Jun 2006 01:44:53 +0000 (01:44 +0000)
typically overflows on x86 CPUs, even though the C standard
requires otherwise.

ChangeLog
doc/autoconf.texi

index 3909f5b3e51b60ff01b928d9ee7a714b1fe4b879..d607f3a3b76ffaf748a80c73d77db423a8c2b966 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2006-06-05  Paul Eggert  <eggert@cs.ucla.edu>
+
+       * doc/autoconf.texi (Integer Overflow): Mention that INT_MIN % -1
+       typically overflows on x86 CPUs, even though the C standard
+       requires otherwise.
+
 2006-06-05  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
 
        * configure.ac (AC_INIT): Bump to 2.59e.
index 4f5fcfdee5dc80ec95d24bb1bccc0e09f48a0c29..098675f34a9edde1068a88cf9a36865392aec382 100644 (file)
@@ -14479,7 +14479,10 @@ to an integer type or store it into an integer variable.  Such programs
 are portable to the vast majority of modern platforms.  However, signed
 integer division is not always harmless: for example, on CPUs of the
 i386 family, dividing @code{INT_MIN} by @code{-1} yields a SIGFPE signal
-which by default terminates the program.
+which by default terminates the program.  Worse, taking the remainder
+of these two values typically yields the same signal on these CPUs,
+even though the C standard requires @code{INT_MIN % -1} to yield zero
+because the expression does not overflow.
 
 GCC users might consider using the
 @option{-ftrapv} option if they are worried about porting their code to