Pull request: Raise SIGFPE instead of abort in __gmp_exception`
vincent at vinc17.net
Tue Jan 12 00:26:00 UTC 2016
On 2016-01-07 21:45:44 +0100, Niels Möller wrote:
> That said, it sounds reasonable to me to replace abort by raise(SIGFPE).
> A configure check may be needed; I think both abort and raise are ANSI
> C, but I suspect SIGFPE isn't.
SIGFPE is at least in ISO C99. I don't know when it was introduced,
but the C rationale says:
7.14 Signal handling <signal.h>
This facility was retained from /usr/group since the C89 Committee
felt it important to provide some standard mechanism for dealing
with exceptional program conditions. Thus a subset of the signals
defined in UNIX were retained in the Standard, along with the basic
mechanisms of declaring signal handlers and, with adaptations,
raising signals (see §126.96.36.199). For a discussion of the problems
created by including signals, see §5.2.3.
The signal machinery contains many misnomers: SIGFPE, SIGILL, and
SIGSEGV have their roots in PDP-11 hardware terminology, but the
names are too entrenched to change. The occurrence of SIGFPE, for
instance, does not necessarily indicate a floating-point error. A
conforming implementation is not required to field any hardware
The C89 Committee has reserved the space of names beginning with
SIG to permit implementations to add local names to <signal.h>.
This implies that such names should not be otherwise used in a C
source file which includes <signal.h>.
Vincent Lefèvre <vincent at vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)
More information about the gmp-devel