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:
parent
ea5b55ecf4
commit
532999f4f2
3 changed files with 31 additions and 8 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue