From: David Gow Date: Thu, 28 Aug 2014 03:47:43 +0000 (+0800) Subject: Crash instead of generating NaN. This breaks everything. X-Git-Url: https://git.ucc.asn.au/?p=ipdf%2Fcode.git;a=commitdiff_plain;h=f7e2b7f153f790e5be704d8bf721f7ce7e30bd1f Crash instead of generating NaN. This breaks everything. --- diff --git a/src/main.cpp b/src/main.cpp index 848debc..f183303 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -3,6 +3,10 @@ #include "controlpanel.h" +#ifndef _GNU_SOURCE +#define _GNU_SOURCE +#endif +#include int main(int argc, char ** argv) @@ -11,6 +15,8 @@ int main(int argc, char ** argv) Warn("__STDC_IEC_559__ not defined. IEEE 754 floating point not fully supported.\n"); #endif + // We want to crash if we ever get a NaN. + feenableexcept(FE_DIVBYZERO | FE_INVALID | FE_OVERFLOW); Debug("Compiled with REAL = %d => \"%s\" sizeof(Real) == %d bytes", REAL, g_real_name[REAL], sizeof(Real));