Skip to content

Commit 9b131a0

Browse files
committed
Fix warning suppression for WARN_PARSE_USING_UNDEF
New warnings for unknown using declarations since fix in previous commit
1 parent cb963a1 commit 9b131a0

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

CHANGES.current

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ the issue number to the end of the URL: https://github.com/swig/swig/issues/
77
Version 4.1.0 (in progress)
88
===========================
99

10+
2022-02-20: wsfulton
11+
Fix %warnfilter warning suppress for warning 315 SWIGWARN_PARSE_USING_UNDEF.
12+
1013
2022-01-29: dontpanic92
1114
#676 Fix code generated for a C++ class with a non-capitalised
1215
name.

Examples/test-suite/using2.i

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
%module using2
22

3-
%warnfilter(SWIGWARN_PARSE_USING_UNDEF);
3+
%warnfilter(SWIGWARN_PARSE_USING_UNDEF) ::baz;
44

55
using ::baz;
66

Source/Swig/symbol.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
* ----------------------------------------------------------------------------- */
1313

1414
#include "swig.h"
15-
#include "swigwarn.h"
15+
#include "cparse.h"
1616
#include <ctype.h>
1717

1818
/* #define SWIG_DEBUG*/
@@ -1182,7 +1182,9 @@ Node *Swig_symbol_clookup(const_String_or_char_ptr name, Symtab *n) {
11821182
Symtab *un = Getattr(s, "sym:symtab");
11831183
Node *ss = (!Equal(name, uname) || (un != n)) ? Swig_symbol_clookup(uname, un) : 0; /* avoid infinity loop */
11841184
if (!ss) {
1185+
SWIG_WARN_NODE_BEGIN(s);
11851186
Swig_warning(WARN_PARSE_USING_UNDEF, Getfile(s), Getline(s), "Nothing known about '%s'.\n", SwigType_namestr(Getattr(s, "uname")));
1187+
SWIG_WARN_NODE_END(s);
11861188
}
11871189
s = ss;
11881190
}
@@ -1254,7 +1256,9 @@ Node *Swig_symbol_clookup_check(const_String_or_char_ptr name, Symtab *n, int (*
12541256
Node *ss;
12551257
ss = Swig_symbol_clookup(Getattr(s, "uname"), Getattr(s, "sym:symtab"));
12561258
if (!ss && !checkfunc) {
1259+
SWIG_WARN_NODE_BEGIN(s);
12571260
Swig_warning(WARN_PARSE_USING_UNDEF, Getfile(s), Getline(s), "Nothing known about '%s'.\n", SwigType_namestr(Getattr(s, "uname")));
1261+
SWIG_WARN_NODE_END(s);
12581262
}
12591263
s = ss;
12601264
}
@@ -1305,7 +1309,9 @@ Node *Swig_symbol_clookup_local(const_String_or_char_ptr name, Symtab *n) {
13051309
while (s && Checkattr(s, "nodeType", "using")) {
13061310
Node *ss = Swig_symbol_clookup_local(Getattr(s, "uname"), Getattr(s, "sym:symtab"));
13071311
if (!ss) {
1312+
SWIG_WARN_NODE_BEGIN(s);
13081313
Swig_warning(WARN_PARSE_USING_UNDEF, Getfile(s), Getline(s), "Nothing known about '%s'.\n", SwigType_namestr(Getattr(s, "uname")));
1314+
SWIG_WARN_NODE_END(s);
13091315
}
13101316
s = ss;
13111317
}
@@ -1353,7 +1359,9 @@ Node *Swig_symbol_clookup_local_check(const_String_or_char_ptr name, Symtab *n,
13531359
while (s && Checkattr(s, "nodeType", "using")) {
13541360
Node *ss = Swig_symbol_clookup_local_check(Getattr(s, "uname"), Getattr(s, "sym:symtab"), checkfunc);
13551361
if (!ss && !checkfunc) {
1362+
SWIG_WARN_NODE_BEGIN(s);
13561363
Swig_warning(WARN_PARSE_USING_UNDEF, Getfile(s), Getline(s), "Nothing known about '%s'.\n", SwigType_namestr(Getattr(s, "uname")));
1364+
SWIG_WARN_NODE_END(s);
13571365
}
13581366
s = ss;
13591367
}

0 commit comments

Comments
 (0)