about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2016-06-06 11:23:00 -0700
committerKartik K. Agaram <vc@akkartik.com>2016-06-06 11:23:00 -0700
commitdfd9ac2b294dc7a135ce530131de886a2420aa01 (patch)
tree8b8159e2870d4ad7208095cbb8c7a13433e1bbfe
parent556fc9a07bf5d22b702dafc7c4a0e9e23eeab04b (diff)
downloadmu-dfd9ac2b294dc7a135ce530131de886a2420aa01.tar.gz
3035
I'd included handling for SIGFPE on faith but I'm not actually able to
see it triggering. Drop it until we can at least test it manually.

In general, floating-point is horrendous: https://hal.archives-ouvertes.fr/hal-00576641v1/document.
Neither types nor tests will help deal with it.
-rw-r--r--001help.cc33
1 files changed, 0 insertions, 33 deletions
diff --git a/001help.cc b/001help.cc
index 830f50a8..25dd27d5 100644
--- a/001help.cc
+++ b/001help.cc
@@ -112,7 +112,6 @@ void initialize_signal_handlers() {
   sigemptyset(&action.sa_mask);
   sigaction(SIGABRT, &action, NULL);  // assert() failure or integer overflow on linux (with -ftrapv)
   sigaction(SIGILL,  &action, NULL);  // integer overflow on OS X (with -ftrapv)
-  sigaction(SIGFPE,  &action, NULL);  // floating-point overflow and underflow
 }
 void dump_and_exit(int sig, siginfo_t* siginfo, unused void* dummy) {
   switch (sig) {
@@ -128,38 +127,6 @@ void dump_and_exit(int sig, siginfo_t* siginfo, unused void* dummy) {
         _Exit(1);
       #endif
       break;
-    case SIGFPE:
-      switch(siginfo->si_code)
-      {
-        case FPE_INTDIV:
-          cerr << "SIGFPE: (integer divide by zero)\n";
-          break;
-        case FPE_INTOVF:
-          cerr << "SIGFPE: (integer overflow)\n";  // dormant; requires hardware support
-          break;
-        case FPE_FLTDIV:
-          cerr << "SIGFPE: (floating-point divide by zero)\n";
-          break;
-        case FPE_FLTOVF:
-          cerr << "SIGFPE: (floating-point overflow)\n";
-          break;
-        case FPE_FLTUND:
-          cerr << "SIGFPE: (floating-point underflow)\n";
-          break;
-        case FPE_FLTRES:
-          cerr << "SIGFPE: (floating-point inexact result)\n";
-          break;
-        case FPE_FLTINV:
-          cerr << "SIGFPE: (floating-point invalid operation)\n";
-          break;
-        case FPE_FLTSUB:
-          cerr << "SIGFPE: (subscript out of range)\n";
-          break;
-        default:
-          cerr << "SIGFPE: arithmetic exception\n";
-          break;
-      }
-      _Exit(1);
     default:
       break;
   }