File: gmp-exception.patch

package info (click to toggle)
julia 1.0.3%2Bdfsg-4
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 49,452 kB
  • sloc: lisp: 236,453; ansic: 55,579; cpp: 25,603; makefile: 1,685; pascal: 1,130; sh: 956; asm: 86; xml: 76
file content (35 lines) | stat: -rw-r--r-- 993 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
diff -r 842c2ba359bf errno.c
--- a/errno.c	Sun Jan 24 22:06:51 2016 +0100
+++ b/errno.c	Thu Jan 28 13:37:54 2016 -0500
@@ -33,24 +33,24 @@
 see https://www.gnu.org/licenses/.  */
 
 #include <stdlib.h>
+
+#include <signal.h>
+
 #include "gmp.h"
 #include "gmp-impl.h"
 
 int gmp_errno = 0;
 
 
-/* The deliberate divide by zero triggers an exception on most systems.  On
-   those where it doesn't, for example power and powerpc, use abort instead.
-
-   Enhancement: Perhaps raise(SIGFPE) (or the same with kill()) would be
-   better than abort.  Perhaps it'd be possible to get the BSD style
-   FPE_INTDIV_TRAP parameter in there too.  */
-
+/* Use SIGFPE on systems which have it. Otherwise, deliberate divide
+   by zero, which triggers an exception on most systems. On those
+   where it doesn't, for example power and powerpc, use abort instead. */
 void
 __gmp_exception (int error_bit)
 {
   gmp_errno |= error_bit;
   __gmp_junk = 10 / __gmp_0;
+  raise (SIGFPE);
   abort ();
 }