Don't report "Warning 202: Error: ..."

An invalid preprocessor expression is reported as a pair of
warnings with the second giving a more detailed message from the
expression evaluator.  Previously SWIG prefixed the second message
with "Error:" - that was confusing as it's actually only a warning
by default so we've now dropped this prefix.

Before:

x.i:1: Warning 202: Could not evaluate expression '1.2'
x.i:1: Warning 202: Error: 'Floating point constant in preprocessor expression'

Now:

x.i:1: Warning 202: Could not evaluate expression '1.2'
x.i:1: Warning 202: Floating point constant in preprocessor expression

See #1465
This commit is contained in:
Olly Betts 2022-02-24 08:40:27 +13:00
commit 74d12d8c4c
5 changed files with 31 additions and 14 deletions

View file

@ -1,6 +1,6 @@
:EOF: Error: Exponent does not have any digits
pp_invalid_exponents.i:3: Warning 202: Could not evaluate expression '123e'
pp_invalid_exponents.i:3: Warning 202: Error: 'Syntax error'
pp_invalid_exponents.i:3: Warning 202: Syntax error
:EOF: Error: Exponent does not have any digits
pp_invalid_exponents.i:6: Warning 202: Could not evaluate expression '456.e'
pp_invalid_exponents.i:6: Warning 202: Error: 'Syntax error'
pp_invalid_exponents.i:6: Warning 202: Syntax error