Report errors in preprocessor expressions by default
Until now SWIG quietly ignored such errors unless -Wextra (or -Wall which implies -Wextra) was passed, but this is unhelpful as it hides problems. To illustrate this point, enabling this warning by default revealled a typo in the preproc_defined.i testcase in SWIG's own testsuite. If you really don't want to see this warning, you can suppress it with command line option -w202 or by using this in your interface file: %warnfilter(SWIGWARN_PP_EVALUATION); Both will work with older versions of SWIG too. Fixes #1465 Fixes #2389
This commit is contained in:
parent
befcd1bf58
commit
06296a7128
7 changed files with 34 additions and 7 deletions
|
|
@ -164,6 +164,15 @@ to provide additional diagnostics. These warnings can be turned on using the
|
|||
</pre>
|
||||
</div>
|
||||
|
||||
<p>
|
||||
Preprocessor warning 202 ("Could not evaluate expression <em>expr</em>.") was
|
||||
formally off by default and enabled by <tt>-Wextra</tt>, but since SWIG 4.1.0
|
||||
this warning is on by default because suppressing it tends to hide genuine
|
||||
problems. If you really don't want to see it, you can suppress it with
|
||||
<tt>-w202</tt> or using <tt>%warnfilter</tt> as described below. Both will work
|
||||
with older versions of SWIG too.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
To selectively turn on extra warning messages, you can use the directives and options in the
|
||||
previous section--simply add a "+" to all warning numbers. For example:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue