From: Paul Eggert Date: Tue, 6 Jun 2006 01:44:53 +0000 (+0000) Subject: * doc/autoconf.texi (Integer Overflow): Mention that INT_MIN % -1 X-Git-Tag: AUTOCONF-2.60~41 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3ede61d43adb2a598705a31da1fb838884dede18;p=thirdparty%2Fautoconf.git * doc/autoconf.texi (Integer Overflow): Mention that INT_MIN % -1 typically overflows on x86 CPUs, even though the C standard requires otherwise. --- diff --git a/ChangeLog b/ChangeLog index 3909f5b3e..d607f3a3b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2006-06-05 Paul Eggert + + * 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 * configure.ac (AC_INIT): Bump to 2.59e. diff --git a/doc/autoconf.texi b/doc/autoconf.texi index 4f5fcfdee..098675f34 100644 --- a/doc/autoconf.texi +++ b/doc/autoconf.texi @@ -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