diff --git a/preprocessor/Makefile.in b/preprocessor/Makefile.in index 3b8a43513..2fc4d8ec2 100644 --- a/preprocessor/Makefile.in +++ b/preprocessor/Makefile.in @@ -1,6 +1,6 @@ CXX = @CXX@ CXXFLAGS = @CXXFLAGS@ -CPPFLAGS = -DNDEBUG @CPPFLAGS@ @DEFS@ +CPPFLAGS = @CPPFLAGS@ @DEFS@ LDFLAGS = @LDFLAGS@ FLEX = @FLEX@ diff --git a/preprocessor/NumericalConstants.cc b/preprocessor/NumericalConstants.cc index de53e4a03..e27ce1c17 100644 --- a/preprocessor/NumericalConstants.cc +++ b/preprocessor/NumericalConstants.cc @@ -19,6 +19,7 @@ #include #include +#include #include #include @@ -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);