#ifdef __linux #define _GNU_SOURCE 1 #include static void __attribute__ ((constructor)) trapfpe(void) { /* Enable some exceptions. At startup all exceptions are masked. */ feenableexcept(FE_INVALID|FE_DIVBYZERO|FE_OVERFLOW); } #else void trapfpe () {} #endif