summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilliam S Fulton <wsf@fultondesigns.co.uk>2022-02-20 16:45:00 +0000
committerWilliam S Fulton <wsf@fultondesigns.co.uk>2022-02-20 16:45:10 +0000
commit9b131a03d52a47dfd2b5b21ad1b76224495cd0bd (patch)
treedc26bce90012826d052a71949a78747e2a92436a
parentcb963a14401b05af36a58a2b76eba3f368354ffd (diff)
downloadswig-9b131a03d52a47dfd2b5b21ad1b76224495cd0bd.tar.gz
Fix warning suppression for WARN_PARSE_USING_UNDEF
New warnings for unknown using declarations since fix in previous commit
-rw-r--r--CHANGES.current3
-rw-r--r--Examples/test-suite/using2.i2
-rw-r--r--Source/Swig/symbol.c10
3 files changed, 13 insertions, 2 deletions
diff --git a/CHANGES.current b/CHANGES.current
index feb058706..b9bbbfe5b 100644
--- a/CHANGES.current
+++ b/CHANGES.current
@@ -7,6 +7,9 @@ the issue number to the end of the URL: https://github.com/swig/swig/issues/
Version 4.1.0 (in progress)
===========================
+2022-02-20: wsfulton
+ Fix %warnfilter warning suppress for warning 315 SWIGWARN_PARSE_USING_UNDEF.
+
2022-01-29: dontpanic92
#676 Fix code generated for a C++ class with a non-capitalised
name.
diff --git a/Examples/test-suite/using2.i b/Examples/test-suite/using2.i
index 1f3dc46f5..1c471c1e5 100644
--- a/Examples/test-suite/using2.i
+++ b/Examples/test-suite/using2.i
@@ -1,6 +1,6 @@
%module using2
-%warnfilter(SWIGWARN_PARSE_USING_UNDEF);
+%warnfilter(SWIGWARN_PARSE_USING_UNDEF) ::baz;
using ::baz;
diff --git a/Source/Swig/symbol.c b/Source/Swig/symbol.c
index 74b4c698d..d3bc720ff 100644
--- a/Source/Swig/symbol.c
+++ b/Source/Swig/symbol.c
@@ -12,7 +12,7 @@
* ----------------------------------------------------------------------------- */
#include "swig.h"
-#include "swigwarn.h"
+#include "cparse.h"
#include <ctype.h>
/* #define SWIG_DEBUG*/
@@ -1182,7 +1182,9 @@ Node *Swig_symbol_clookup(const_String_or_char_ptr name, Symtab *n) {
Symtab *un = Getattr(s, "sym:symtab");
Node *ss = (!Equal(name, uname) || (un != n)) ? Swig_symbol_clookup(uname, un) : 0; /* avoid infinity loop */
if (!ss) {
+ SWIG_WARN_NODE_BEGIN(s);
Swig_warning(WARN_PARSE_USING_UNDEF, Getfile(s), Getline(s), "Nothing known about '%s'.\n", SwigType_namestr(Getattr(s, "uname")));
+ SWIG_WARN_NODE_END(s);
}
s = ss;
}
@@ -1254,7 +1256,9 @@ Node *Swig_symbol_clookup_check(const_String_or_char_ptr name, Symtab *n, int (*
Node *ss;
ss = Swig_symbol_clookup(Getattr(s, "uname"), Getattr(s, "sym:symtab"));
if (!ss && !checkfunc) {
+ SWIG_WARN_NODE_BEGIN(s);
Swig_warning(WARN_PARSE_USING_UNDEF, Getfile(s), Getline(s), "Nothing known about '%s'.\n", SwigType_namestr(Getattr(s, "uname")));
+ SWIG_WARN_NODE_END(s);
}
s = ss;
}
@@ -1305,7 +1309,9 @@ Node *Swig_symbol_clookup_local(const_String_or_char_ptr name, Symtab *n) {
while (s && Checkattr(s, "nodeType", "using")) {
Node *ss = Swig_symbol_clookup_local(Getattr(s, "uname"), Getattr(s, "sym:symtab"));
if (!ss) {
+ SWIG_WARN_NODE_BEGIN(s);
Swig_warning(WARN_PARSE_USING_UNDEF, Getfile(s), Getline(s), "Nothing known about '%s'.\n", SwigType_namestr(Getattr(s, "uname")));
+ SWIG_WARN_NODE_END(s);
}
s = ss;
}
@@ -1353,7 +1359,9 @@ Node *Swig_symbol_clookup_local_check(const_String_or_char_ptr name, Symtab *n,
while (s && Checkattr(s, "nodeType", "using")) {
Node *ss = Swig_symbol_clookup_local_check(Getattr(s, "uname"), Getattr(s, "sym:symtab"), checkfunc);
if (!ss && !checkfunc) {
+ SWIG_WARN_NODE_BEGIN(s);
Swig_warning(WARN_PARSE_USING_UNDEF, Getfile(s), Getline(s), "Nothing known about '%s'.\n", SwigType_namestr(Getattr(s, "uname")));
+ SWIG_WARN_NODE_END(s);
}
s = ss;
}