Fix warning suppression for WARN_PARSE_USING_UNDEF

New warnings for unknown using declarations since fix in previous commit
This commit is contained in:
William S Fulton 2022-02-20 16:45:00 +00:00
parent cb963a1440
commit 9b131a03d5
3 changed files with 13 additions and 2 deletions

View File

@ -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) 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 2022-01-29: dontpanic92
#676 Fix code generated for a C++ class with a non-capitalised #676 Fix code generated for a C++ class with a non-capitalised
name. name.

View File

@ -1,6 +1,6 @@
%module using2 %module using2
%warnfilter(SWIGWARN_PARSE_USING_UNDEF); %warnfilter(SWIGWARN_PARSE_USING_UNDEF) ::baz;
using ::baz; using ::baz;

View File

@ -12,7 +12,7 @@
* ----------------------------------------------------------------------------- */ * ----------------------------------------------------------------------------- */
#include "swig.h" #include "swig.h"
#include "swigwarn.h" #include "cparse.h"
#include <ctype.h> #include <ctype.h>
/* #define SWIG_DEBUG*/ /* #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"); Symtab *un = Getattr(s, "sym:symtab");
Node *ss = (!Equal(name, uname) || (un != n)) ? Swig_symbol_clookup(uname, un) : 0; /* avoid infinity loop */ Node *ss = (!Equal(name, uname) || (un != n)) ? Swig_symbol_clookup(uname, un) : 0; /* avoid infinity loop */
if (!ss) { 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_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; s = ss;
} }
@ -1254,7 +1256,9 @@ Node *Swig_symbol_clookup_check(const_String_or_char_ptr name, Symtab *n, int (*
Node *ss; Node *ss;
ss = Swig_symbol_clookup(Getattr(s, "uname"), Getattr(s, "sym:symtab")); ss = Swig_symbol_clookup(Getattr(s, "uname"), Getattr(s, "sym:symtab"));
if (!ss && !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_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; 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")) { while (s && Checkattr(s, "nodeType", "using")) {
Node *ss = Swig_symbol_clookup_local(Getattr(s, "uname"), Getattr(s, "sym:symtab")); Node *ss = Swig_symbol_clookup_local(Getattr(s, "uname"), Getattr(s, "sym:symtab"));
if (!ss) { 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_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; 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")) { while (s && Checkattr(s, "nodeType", "using")) {
Node *ss = Swig_symbol_clookup_local_check(Getattr(s, "uname"), Getattr(s, "sym:symtab"), checkfunc); Node *ss = Swig_symbol_clookup_local_check(Getattr(s, "uname"), Getattr(s, "sym:symtab"), checkfunc);
if (!ss && !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_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; s = ss;
} }