Improve error message when preprocessor expressions result in a floating point constant

Instead of a syntax error, the error is now:
  Warning 202: Error: 'Floating point constant in preprocessor expression'
This commit is contained in:
William S Fulton 2018-01-15 08:09:14 +00:00
commit 532999f4f2
3 changed files with 31 additions and 8 deletions

View file

@ -319,6 +319,10 @@ int Preprocessor_expr(DOH *s, int *error) {
stack[sp].value = 0;
stack[sp].svalue = 0;
stack[sp].op = EXPR_VALUE;
} else if ((token == SWIG_TOKEN_FLOAT) || (token == SWIG_TOKEN_DOUBLE)) {
errmsg = "Floating point constant in preprocessor expression";
*error = 1;
return 0;
} else
goto syntax_error;
break;