diff --git a/Makefile.in b/Makefile.in index 3b8a4351371a031e2b3c8035b4b442137e959a44..2fc4d8ec299788ac45c9f2f80590fd38079848dc 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1,6 +1,6 @@ CXX = @CXX@ CXXFLAGS = @CXXFLAGS@ -CPPFLAGS = -DNDEBUG @CPPFLAGS@ @DEFS@ +CPPFLAGS = @CPPFLAGS@ @DEFS@ LDFLAGS = @LDFLAGS@ FLEX = @FLEX@ diff --git a/NumericalConstants.cc b/NumericalConstants.cc index de53e4a03d9e66544c37f801cf54d3987bd4c82e..e27ce1c175713ae326d9c7869a32c8d0f043f728 100644 --- a/NumericalConstants.cc +++ b/NumericalConstants.cc @@ -19,6 +19,7 @@ #include <cstdlib> #include <cassert> +#include <cerrno> #include <cmath> #include <iostream> @@ -36,9 +37,9 @@ NumericalConstants::AddConstant(const string &iConst) mNumericalConstants.push_back(iConst); numConstantsIndex[iConst] = id; - char *endptr; - double val = strtod(iConst.c_str(), &endptr); - assert(endptr != iConst.c_str()); // Check that the conversion succeeded + errno = 0; + double val = strtod(iConst.c_str(), NULL); + assert(errno == 0); // Check that the conversion succeeded assert(val >= 0 || isnan(val)); // Check we have a positive constant or a NaN double_vals.push_back(val);