Pull request: Raise SIGFPE instead of abort in __gmp_exception`

Yichao Yu yyc1992 at gmail.com
Mon Jan 11 22:36:07 UTC 2016

On Mon, Jan 11, 2016 at 5:30 PM, Yichao Yu <yyc1992 at gmail.com> wrote:
> On Mon, Jan 11, 2016 at 5:17 PM, Torbjörn Granlund <tg at gmplib.org> wrote:
>> nisse at lysator.liu.se (Niels Möller) writes:
>>   > Hmm. What about `#ifdef` on `SIGFPE` and `abort` otherwise. This
>>   > should be a sane enough default for the even when the custom handler
>>   > is added.
>>   Sounds good enough. If noone objects, I'll make a patch to do that and
>>   try the patch approval procedure at work.
>> No system uses enums for these?
> Actually this should be standard C89?
> http://en.cppreference.com/w/c/program/SIG_types

And it seems that in all of the standards C89, C99 and C11 SIGFPE is listed as

> The macros defined are <.....>; and the following, which expand to positive integer constant expressions with type int and distinct values that are the signal numbers, each corresponding to the specified condition: <.....> SIGFPE.

So it seems that SIGFPE is required to be defined and has to be a
macro. (define as enum and then redefine as macro should be fine

>> --
>> Torbjörn
>> Please encrypt, key id 0xC8601622

More information about the gmp-devel mailing list