From f7e2b7f153f790e5be704d8bf721f7ce7e30bd1f Mon Sep 17 00:00:00 2001 From: David Gow Date: Thu, 28 Aug 2014 11:47:43 +0800 Subject: [PATCH 1/1] Crash instead of generating NaN. This breaks everything. --- src/main.cpp | 6 ++++++ 1 file changed, 6 insertions(+) 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)); -- 2.20.1