[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
minor doc fix for INT_MIN % -1
From: |
Paul Eggert |
Subject: |
minor doc fix for INT_MIN % -1 |
Date: |
Mon, 05 Jun 2006 19:29:21 -0700 |
User-agent: |
Gnus/5.1008 (Gnus v5.10.8) Emacs/21.4 (gnu/linux) |
I installed this:
2006-06-05 Paul Eggert <address@hidden>
* doc/autoconf.texi (Integer Overflow): Mention that INT_MIN % -1
typically overflows on x86 CPUs, even though the C standard
requires otherwise.
--- doc/autoconf.texi 5 Jun 2006 08:39:57 -0000 1.1040
+++ doc/autoconf.texi 6 Jun 2006 01:44:53 -0000 1.1041
@@ -14479,7 +14479,10 @@ to an integer type or store it into an i
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
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- minor doc fix for INT_MIN % -1,
Paul Eggert <=