Pull request: Raise SIGFPE instead of abort in __gmp_exception`

Yichao Yu yyc1992 at gmail.com
Tue Jan 12 01:29:39 UTC 2016

On Mon, Jan 11, 2016 at 7:26 PM, Vincent Lefevre <vincent at vinc17.net> wrote:
> 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:

It's in C89 as well,

This is where I find the section about SIGFPE should be defined as a
maco in <signal.h> http://port70.net/~nsz/c/c89/c89-draft.html#4.7

>   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 § 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
>   interrupts.
>   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)
> _______________________________________________
> gmp-devel mailing list
> gmp-devel at gmplib.org
> https://gmplib.org/mailman/listinfo/gmp-devel

More information about the gmp-devel mailing list