From 52ede59cdf2c5889335636c884ff64a7319319e3 Mon Sep 17 00:00:00 2001
From: William S Fulton
Date: Thu, 27 Jul 2023 07:34:47 +0100
Subject: [PATCH] Reword and simplify warnings 302 and 322
The declaration is not displayed in the warning if it is the same as the
identifier.
---
Doc/Manual/SWIG.html | 3 +-
Doc/Manual/Warnings.html | 4 +-
Examples/test-suite/errors/c_redefine.stderr | 6 +--
.../errors/c_redefine_typedef.stderr | 8 ++--
.../errors/cpp_class_definition.stderr | 2 +-
.../errors/cpp_extend_destructors.stderr | 6 +--
.../errors/cpp_extend_redefine.stderr | 2 +-
.../test-suite/errors/cpp_redefine_class.i | 38 +++++++++++++++++++
.../errors/cpp_redefine_class.stderr | 8 ++++
.../cpp_template_duplicate_names.stderr | 8 ++--
.../errors/cpp_template_friend.stderr | 12 +++---
.../errors/cpp_template_redefine.stderr | 24 ++++++------
Examples/test-suite/redefined_not.i | 2 +-
Source/CParse/parser.y | 20 +++++-----
14 files changed, 96 insertions(+), 47 deletions(-)
create mode 100644 Examples/test-suite/errors/cpp_redefine_class.i
create mode 100644 Examples/test-suite/errors/cpp_redefine_class.stderr
diff --git a/Doc/Manual/SWIG.html b/Doc/Manual/SWIG.html
index d0289212b..59aeffe7c 100644
--- a/Doc/Manual/SWIG.html
+++ b/Doc/Manual/SWIG.html
@@ -2527,8 +2527,9 @@ for the above example you'll get:
-foo.i:5: Warning 302: Identifier 'Foo' redefined (ignored),
+foo.i:5: Warning 302: Redefinition of identifier 'Foo' as Foo(void) ignored,
foo.i:1: Warning 302: previous definition of 'Foo'.
+
diff --git a/Doc/Manual/Warnings.html b/Doc/Manual/Warnings.html
index 8bfc0a899..5f2eb3656 100644
--- a/Doc/Manual/Warnings.html
+++ b/Doc/Manual/Warnings.html
@@ -392,7 +392,7 @@ example.i(4) : Syntax error in input(1).
- 301. class keyword used, but not in C++ mode.
-
- 302. Identifier 'name' redefined (ignored).
+
- 302. Redefinition of identifier 'name' as decl ignored.
- 303. %extend defined for an undeclared class 'name'.
- 305. Bad constant value (ignored).
- 306. 'identifier' is private in this context.
@@ -409,7 +409,7 @@ example.i(4) : Syntax error in input(1).
- 319. No access specifier given for base class name (ignored).
- 320. Explicit template instantiation ignored.
- 321. identifier conflicts with a built-in name.
-
- 322. Redundant redeclaration of 'name'.
+
- 322. Redundant redeclaration of identifier 'name' as decl ignored.
- 323. Recursive scope inheritance of 'name'.
- 324. Named nested template instantiations not supported. Processing as if no name was given to %template().
- 325. Nested kind not currently supported (name ignored).
diff --git a/Examples/test-suite/errors/c_redefine.stderr b/Examples/test-suite/errors/c_redefine.stderr
index dfb51e821..a5996d117 100644
--- a/Examples/test-suite/errors/c_redefine.stderr
+++ b/Examples/test-suite/errors/c_redefine.stderr
@@ -1,6 +1,6 @@
-c_redefine.i:4: Warning 302: Redefinition of identifier 'foo' (ignored) as foo,
+c_redefine.i:4: Warning 302: Redefinition of identifier 'foo' ignored,
c_redefine.i:3: Warning 302: previous definition of 'foo' as foo(int,int).
-c_redefine.i:8: Warning 302: Redefinition of identifier 'bar' (ignored) as bar,
+c_redefine.i:8: Warning 302: Redefinition of identifier 'bar' ignored,
c_redefine.i:6: Warning 302: previous definition of 'bar' as bar(int).
-c_redefine.i:14: Warning 322: Redundant redeclaration of identifier 'bar' as spam(int) (Renamed from 'spam'),
+c_redefine.i:14: Warning 322: Redundant redeclaration of identifier 'bar' (Renamed from 'spam') as spam(int) ignored,
c_redefine.i:6: Warning 322: previous declaration of 'bar' as bar(int).
diff --git a/Examples/test-suite/errors/c_redefine_typedef.stderr b/Examples/test-suite/errors/c_redefine_typedef.stderr
index 89906918e..60b63f0de 100644
--- a/Examples/test-suite/errors/c_redefine_typedef.stderr
+++ b/Examples/test-suite/errors/c_redefine_typedef.stderr
@@ -1,4 +1,4 @@
-c_redefine_typedef.i:10: Warning 302: Redefinition of identifier 'MyStruct' (ignored) as MyStruct,
-c_redefine_typedef.i:7: Warning 302: previous definition of 'MyStruct' as MyStruct.
-c_redefine_typedef.i:15: Warning 322: Redundant redeclaration of identifier 'Int' as Int,
-c_redefine_typedef.i:14: Warning 322: previous declaration of 'Int' as Int.
+c_redefine_typedef.i:10: Warning 302: Redefinition of identifier 'MyStruct' ignored,
+c_redefine_typedef.i:7: Warning 302: previous definition of 'MyStruct'.
+c_redefine_typedef.i:15: Warning 322: Redundant redeclaration of identifier 'Int' ignored,
+c_redefine_typedef.i:14: Warning 322: previous declaration of 'Int'.
diff --git a/Examples/test-suite/errors/cpp_class_definition.stderr b/Examples/test-suite/errors/cpp_class_definition.stderr
index 36012b4a3..744ae70af 100644
--- a/Examples/test-suite/errors/cpp_class_definition.stderr
+++ b/Examples/test-suite/errors/cpp_class_definition.stderr
@@ -1,4 +1,4 @@
-cpp_class_definition.i:11: Warning 302: Redefinition of identifier 'L' (ignored) as Space11::SubSpace11::L,
+cpp_class_definition.i:11: Warning 302: Redefinition of identifier 'L' as Space11::SubSpace11::L ignored,
cpp_class_definition.i:10: Warning 302: previous definition of 'L' as Space11::SubSpace11::L.
cpp_class_definition.i:22: Error: 'Space1::A' resolves to 'Space1::A' and was incorrectly instantiated in scope 'Space2' instead of within scope 'Space1'.
cpp_class_definition.i:31: Error: Using the unary scope operator :: in class definition '::Space2::B' is invalid.
diff --git a/Examples/test-suite/errors/cpp_extend_destructors.stderr b/Examples/test-suite/errors/cpp_extend_destructors.stderr
index 0ad95ba14..1a3def727 100644
--- a/Examples/test-suite/errors/cpp_extend_destructors.stderr
+++ b/Examples/test-suite/errors/cpp_extend_destructors.stderr
@@ -1,10 +1,10 @@
cpp_extend_destructors.i:8: Warning 302: Identifier '~AStruct' redefined by %extend (ignored),
cpp_extend_destructors.i:5: Warning 302: %extend definition of '~AStruct'.
-cpp_extend_destructors.i:14: Warning 302: Redefinition of identifier '~BStruct' (ignored) as BStruct::~BStruct(),
+cpp_extend_destructors.i:14: Warning 302: Redefinition of identifier '~BStruct' as BStruct::~BStruct() ignored,
cpp_extend_destructors.i:13: Warning 302: previous definition of '~BStruct' as BStruct::~BStruct().
-cpp_extend_destructors.i:87: Warning 302: Redefinition of identifier '~JStruct' (ignored) as JStruct::~JStruct(),
+cpp_extend_destructors.i:87: Warning 302: Redefinition of identifier '~JStruct' as JStruct::~JStruct() ignored,
cpp_extend_destructors.i:85: Warning 302: previous definition of '~JStruct' as JStruct::~JStruct().
-cpp_extend_destructors.i:100: Warning 302: Redefinition of identifier '~LStruct' (ignored) as LStruct::~LStruct(),
+cpp_extend_destructors.i:100: Warning 302: Redefinition of identifier '~LStruct' as LStruct::~LStruct() ignored,
cpp_extend_destructors.i:98: Warning 302: previous definition of '~LStruct' as LStruct::~LStruct().
cpp_extend_destructors.i:24: Warning 521: Illegal destructor name CStruct::~NOT_CStruct(). Ignored.
cpp_extend_destructors.i:30: Warning 521: Illegal destructor name DStruct::~NOT_DStruct(). Ignored.
diff --git a/Examples/test-suite/errors/cpp_extend_redefine.stderr b/Examples/test-suite/errors/cpp_extend_redefine.stderr
index 7b9a666dc..436d24a76 100644
--- a/Examples/test-suite/errors/cpp_extend_redefine.stderr
+++ b/Examples/test-suite/errors/cpp_extend_redefine.stderr
@@ -1,4 +1,4 @@
cpp_extend_redefine.i:9: Warning 302: Identifier 'bar' redefined by %extend (ignored),
cpp_extend_redefine.i:5: Warning 302: %extend definition of 'bar'.
-cpp_extend_redefine.i:14: Warning 322: Redundant redeclaration of identifier 'spam' as foo::spam(),
+cpp_extend_redefine.i:14: Warning 322: Redundant redeclaration of identifier 'spam' as foo::spam() ignored,
cpp_extend_redefine.i:10: Warning 322: previous declaration of 'spam' as foo::spam().
diff --git a/Examples/test-suite/errors/cpp_redefine_class.i b/Examples/test-suite/errors/cpp_redefine_class.i
new file mode 100644
index 000000000..ffffc154b
--- /dev/null
+++ b/Examples/test-suite/errors/cpp_redefine_class.i
@@ -0,0 +1,38 @@
+%module xxx
+
+namespace Space {
+struct MyStruct {
+ int b;
+};
+}
+
+namespace Space {
+struct MyStruct {
+ int b;
+};
+}
+
+namespace Space {
+class MyClass {
+public:
+ int a;
+};
+}
+
+class Space::MyClass {
+public:
+ int a;
+};
+
+namespace Space {
+template
+class MyTemplateClass {
+public:
+ int a;
+};
+template
+class MyTemplateClass {
+public:
+ int a;
+};
+}
diff --git a/Examples/test-suite/errors/cpp_redefine_class.stderr b/Examples/test-suite/errors/cpp_redefine_class.stderr
new file mode 100644
index 000000000..95d2ff7ef
--- /dev/null
+++ b/Examples/test-suite/errors/cpp_redefine_class.stderr
@@ -0,0 +1,8 @@
+cpp_redefine_class.i:10: Warning 302: Redefinition of identifier 'MyStruct' as Space::MyStruct ignored,
+cpp_redefine_class.i:4: Warning 302: previous definition of 'MyStruct' as Space::MyStruct.
+cpp_redefine_class.i:22: Warning 302: Redefinition of identifier 'MyClass' as Space::MyClass ignored,
+cpp_redefine_class.i:16: Warning 302: previous definition of 'MyClass' as Space::MyClass.
+cpp_redefine_class.i:34: Warning 302: Redefinition of identifier 'MyTemplateClass' as Space::MyTemplateClass ignored,
+cpp_redefine_class.i:29: Warning 302: previous definition of 'MyTemplateClass' as Space::MyTemplateClass.
+cpp_redefine_class.i:34: Warning 302: Redefinition of identifier 'MyTemplateClass' as Space::MyTemplateClass ignored,
+cpp_redefine_class.i:29: Warning 302: previous definition of 'MyTemplateClass' as Space::MyTemplateClass.
diff --git a/Examples/test-suite/errors/cpp_template_duplicate_names.stderr b/Examples/test-suite/errors/cpp_template_duplicate_names.stderr
index f62ef5ed6..f1acbc29e 100644
--- a/Examples/test-suite/errors/cpp_template_duplicate_names.stderr
+++ b/Examples/test-suite/errors/cpp_template_duplicate_names.stderr
@@ -1,14 +1,14 @@
-cpp_template_duplicate_names.i:14: Warning 302: Redefinition of identifier 'Duplicate1' (ignored) as Space::Duplicate1,
+cpp_template_duplicate_names.i:14: Warning 302: Redefinition of identifier 'Duplicate1' as Space::Duplicate1 ignored,
cpp_template_duplicate_names.i:13: Warning 302: previous definition of 'Duplicate1' as Space::Duplicate1.
-cpp_template_duplicate_names.i:14: Warning 302: Redefinition of identifier 'Duplicate1' (ignored) as Space::Duplicate1,
+cpp_template_duplicate_names.i:14: Warning 302: Redefinition of identifier 'Duplicate1' as Space::Duplicate1 ignored,
cpp_template_duplicate_names.i:13: Warning 302: previous definition of 'Duplicate1' as Space::Duplicate1.
cpp_template_duplicate_names.i:25: Warning 404: Duplicate template instantiation of 'Duplicate2< 0 >' with name 'Duplicate2_0' ignored,
cpp_template_duplicate_names.i:24: Warning 404: previous instantiation of 'Duplicate2< 0 >' with name 'Duplicate2_0'.
cpp_template_duplicate_names.i:35: Warning 404: Duplicate template instantiation of 'Duplicate3< 0 >' with name 'Duplicate3' ignored,
cpp_template_duplicate_names.i:34: Warning 404: previous instantiation of 'Duplicate3< 0 >' with name 'Duplicate3'.
-cpp_template_duplicate_names.i:47: Warning 302: Redefinition of identifier 'Duplicate4' (ignored) as Space::Duplicate4,
+cpp_template_duplicate_names.i:47: Warning 302: Redefinition of identifier 'Duplicate4' as Space::Duplicate4 ignored,
cpp_template_duplicate_names.i:46: Warning 302: previous definition of 'Duplicate4' as Space::Duplicate4.
-cpp_template_duplicate_names.i:47: Warning 302: Redefinition of identifier 'Duplicate4' (ignored) as Space::Duplicate4,
+cpp_template_duplicate_names.i:47: Warning 302: Redefinition of identifier 'Duplicate4' as Space::Duplicate4 ignored,
cpp_template_duplicate_names.i:46: Warning 302: previous definition of 'Duplicate4' as Space::Duplicate4.
cpp_template_duplicate_names.i:50: Warning 404: Duplicate template instantiation of 'Duplicate4< 0 >' with name 'Duplicate4' ignored,
cpp_template_duplicate_names.i:49: Warning 404: previous instantiation of 'Duplicate4< 0 >' with name 'Duplicate4'.
diff --git a/Examples/test-suite/errors/cpp_template_friend.stderr b/Examples/test-suite/errors/cpp_template_friend.stderr
index 3653f6916..04ecc8648 100644
--- a/Examples/test-suite/errors/cpp_template_friend.stderr
+++ b/Examples/test-suite/errors/cpp_template_friend.stderr
@@ -1,8 +1,8 @@
-cpp_template_friend.i:4: Warning 302: Redefinition of identifier 'template_friend1' (ignored) as template_friend1,
-cpp_template_friend.i:3: Warning 302: previous definition of 'template_friend1' as template_friend1.
-cpp_template_friend.i:13: Warning 302: Redefinition of identifier 'template_friend2' (ignored) as template_friend2,
-cpp_template_friend.i:9: Warning 302: previous definition of 'template_friend2' as template_friend2.
-cpp_template_friend.i:17: Warning 322: Redundant redeclaration of identifier 'normal_friend1' as normal_friend1(int),
+cpp_template_friend.i:4: Warning 302: Redefinition of identifier 'template_friend1' ignored,
+cpp_template_friend.i:3: Warning 302: previous definition of 'template_friend1'.
+cpp_template_friend.i:13: Warning 302: Redefinition of identifier 'template_friend2' ignored,
+cpp_template_friend.i:9: Warning 302: previous definition of 'template_friend2'.
+cpp_template_friend.i:17: Warning 322: Redundant redeclaration of identifier 'normal_friend1' as normal_friend1(int) ignored,
cpp_template_friend.i:16: Warning 322: previous declaration of 'normal_friend1' as normal_friend1(int).
-cpp_template_friend.i:26: Warning 322: Redundant redeclaration of identifier 'normal_friend2' as normal_friend2(int),
+cpp_template_friend.i:26: Warning 322: Redundant redeclaration of identifier 'normal_friend2' as normal_friend2(int) ignored,
cpp_template_friend.i:22: Warning 322: previous declaration of 'normal_friend2' as normal_friend2(int).
diff --git a/Examples/test-suite/errors/cpp_template_redefine.stderr b/Examples/test-suite/errors/cpp_template_redefine.stderr
index b2f8fc525..4b15c2fd8 100644
--- a/Examples/test-suite/errors/cpp_template_redefine.stderr
+++ b/Examples/test-suite/errors/cpp_template_redefine.stderr
@@ -4,27 +4,27 @@ cpp_template_redefine.i:50: Warning 344: Unable to deduce decltype for '*std::de
cpp_template_redefine.i:56: Warning 344: Unable to deduce decltype for '&T::to_json'.
cpp_template_redefine.i:59: Warning 344: Unable to deduce decltype for 'std::declval().begin()->first'.
cpp_template_redefine.i:63: Warning 344: Unable to deduce decltype for '*std::declval().begin()'.
-cpp_template_redefine.i:101: Warning 322: Redundant redeclaration of identifier 'Json' as Json::Json(Converter const &),
+cpp_template_redefine.i:101: Warning 322: Redundant redeclaration of identifier 'Json' as Json::Json(Converter const &) ignored,
cpp_template_redefine.i:101: Warning 322: previous declaration of 'Json' as Json::Json(Converter const &).
-cpp_template_redefine.i:101: Warning 322: Redundant redeclaration of identifier 'Json' as Json::Json(Converter const &),
+cpp_template_redefine.i:101: Warning 322: Redundant redeclaration of identifier 'Json' as Json::Json(Converter const &) ignored,
cpp_template_redefine.i:101: Warning 322: previous declaration of 'Json' as Json::Json(Converter const &).
-cpp_template_redefine.i:102: Warning 322: Redundant redeclaration of identifier 'Json' as Json::Json(std::map< std::string,std::string,std::less< std::string >,std::allocator< std::pair< std::string const,std::string > > > const &),
+cpp_template_redefine.i:102: Warning 322: Redundant redeclaration of identifier 'Json' as Json::Json(std::map< std::string,std::string,std::less< std::string >,std::allocator< std::pair< std::string const,std::string > > > const &) ignored,
cpp_template_redefine.i:102: Warning 322: previous declaration of 'Json' as Json::Json(std::map< std::string,std::string,std::less< std::string >,std::allocator< std::pair< std::string const,std::string > > > const &).
-cpp_template_redefine.i:102: Warning 322: Redundant redeclaration of identifier 'Json' as Json::Json(std::map< std::string,std::string,std::less< std::string >,std::allocator< std::pair< std::string const,std::string > > > const &),
+cpp_template_redefine.i:102: Warning 322: Redundant redeclaration of identifier 'Json' as Json::Json(std::map< std::string,std::string,std::less< std::string >,std::allocator< std::pair< std::string const,std::string > > > const &) ignored,
cpp_template_redefine.i:102: Warning 322: previous declaration of 'Json' as Json::Json(std::map< std::string,std::string,std::less< std::string >,std::allocator< std::pair< std::string const,std::string > > > const &).
-cpp_template_redefine.i:103: Warning 322: Redundant redeclaration of identifier 'Json' as Json::Json(std::vector< std::string,std::allocator< std::string > > const &),
+cpp_template_redefine.i:103: Warning 322: Redundant redeclaration of identifier 'Json' as Json::Json(std::vector< std::string,std::allocator< std::string > > const &) ignored,
cpp_template_redefine.i:103: Warning 322: previous declaration of 'Json' as Json::Json(std::vector< std::string,std::allocator< std::string > > const &).
-cpp_template_redefine.i:103: Warning 322: Redundant redeclaration of identifier 'Json' as Json::Json(std::vector< std::string,std::allocator< std::string > > const &),
+cpp_template_redefine.i:103: Warning 322: Redundant redeclaration of identifier 'Json' as Json::Json(std::vector< std::string,std::allocator< std::string > > const &) ignored,
cpp_template_redefine.i:103: Warning 322: previous declaration of 'Json' as Json::Json(std::vector< std::string,std::allocator< std::string > > const &).
-cpp_template_redefine.i:105: Warning 322: Redundant redeclaration of identifier 'mmm' as Json::mmm< Converter,std::string >(Converter const &),
+cpp_template_redefine.i:105: Warning 322: Redundant redeclaration of identifier 'mmm' as Json::mmm< Converter,std::string >(Converter const &) ignored,
cpp_template_redefine.i:105: Warning 322: previous declaration of 'mmm' as Json::mmm< Converter,std::string >(Converter const &).
-cpp_template_redefine.i:105: Warning 322: Redundant redeclaration of identifier 'mmm' as Json::mmm< Converter,std::string >(Converter const &),
+cpp_template_redefine.i:105: Warning 322: Redundant redeclaration of identifier 'mmm' as Json::mmm< Converter,std::string >(Converter const &) ignored,
cpp_template_redefine.i:105: Warning 322: previous declaration of 'mmm' as Json::mmm< Converter,std::string >(Converter const &).
-cpp_template_redefine.i:106: Warning 322: Redundant redeclaration of identifier 'mmm' as Json::mmm< std::map< std::string,std::string >,0 >(std::map< std::string,std::string,std::less< std::string >,std::allocator< std::pair< std::string const,std::string > > > const &),
+cpp_template_redefine.i:106: Warning 322: Redundant redeclaration of identifier 'mmm' as Json::mmm< std::map< std::string,std::string >,0 >(std::map< std::string,std::string,std::less< std::string >,std::allocator< std::pair< std::string const,std::string > > > const &) ignored,
cpp_template_redefine.i:106: Warning 322: previous declaration of 'mmm' as Json::mmm< std::map< std::string,std::string >,0 >(std::map< std::string,std::string,std::less< std::string >,std::allocator< std::pair< std::string const,std::string > > > const &).
-cpp_template_redefine.i:106: Warning 322: Redundant redeclaration of identifier 'mmm' as Json::mmm< std::map< std::string,std::string >,0 >(std::map< std::string,std::string,std::less< std::string >,std::allocator< std::pair< std::string const,std::string > > > const &),
+cpp_template_redefine.i:106: Warning 322: Redundant redeclaration of identifier 'mmm' as Json::mmm< std::map< std::string,std::string >,0 >(std::map< std::string,std::string,std::less< std::string >,std::allocator< std::pair< std::string const,std::string > > > const &) ignored,
cpp_template_redefine.i:106: Warning 322: previous declaration of 'mmm' as Json::mmm< std::map< std::string,std::string >,0 >(std::map< std::string,std::string,std::less< std::string >,std::allocator< std::pair< std::string const,std::string > > > const &).
-cpp_template_redefine.i:107: Warning 322: Redundant redeclaration of identifier 'mmm' as Json::mmm< std::vector< std::string >,0 >(std::vector< std::string,std::allocator< std::string > > const &),
+cpp_template_redefine.i:107: Warning 322: Redundant redeclaration of identifier 'mmm' as Json::mmm< std::vector< std::string >,0 >(std::vector< std::string,std::allocator< std::string > > const &) ignored,
cpp_template_redefine.i:107: Warning 322: previous declaration of 'mmm' as Json::mmm< std::vector< std::string >,0 >(std::vector< std::string,std::allocator< std::string > > const &).
-cpp_template_redefine.i:107: Warning 322: Redundant redeclaration of identifier 'mmm' as Json::mmm< std::vector< std::string >,0 >(std::vector< std::string,std::allocator< std::string > > const &),
+cpp_template_redefine.i:107: Warning 322: Redundant redeclaration of identifier 'mmm' as Json::mmm< std::vector< std::string >,0 >(std::vector< std::string,std::allocator< std::string > > const &) ignored,
cpp_template_redefine.i:107: Warning 322: previous declaration of 'mmm' as Json::mmm< std::vector< std::string >,0 >(std::vector< std::string,std::allocator< std::string > > const &).
diff --git a/Examples/test-suite/redefined_not.i b/Examples/test-suite/redefined_not.i
index fde5994fb..22169ff25 100644
--- a/Examples/test-suite/redefined_not.i
+++ b/Examples/test-suite/redefined_not.i
@@ -1,6 +1,6 @@
%module redefined_not
-// These should not emit an Identifier redefined warning
+// These should not emit a 'Redefinition of identifier' warning
%inline %{
typedef unsigned int my_size_t;
namespace Std {
diff --git a/Source/CParse/parser.y b/Source/CParse/parser.y
index 6009054de..87452660a 100644
--- a/Source/CParse/parser.y
+++ b/Source/CParse/parser.y
@@ -687,19 +687,21 @@ static void add_symbols(Node *n) {
String *n_name_decl = Swig_name_decl(n);
String *c_name_decl = Swig_name_decl(c);
if (redefined) {
- Printf(en, "Redefinition of identifier '%s' (ignored) as %s", symname_stripped, n_name_decl);
- Printf(ec, "previous definition of '%s' as %s", symname_stripped, c_name_decl);
+ Printf(en, "Redefinition of identifier '%s'", symname_stripped);
+ Printf(ec, "previous definition of '%s'", symname_stripped);
} else {
- Printf(en, "Redundant redeclaration of identifier '%s' as %s", symname_stripped, n_name_decl);
- Printf(ec, "previous declaration of '%s' as %s", symname_stripped, c_name_decl);
+ Printf(en, "Redundant redeclaration of identifier '%s'", symname_stripped);
+ Printf(ec, "previous declaration of '%s'", symname_stripped);
}
- if (!Equal(symname_stripped, n_name_stripped)) {
+ if (!Equal(symname_stripped, n_name_stripped))
Printf(en, " (Renamed from '%s')", SwigType_namestr(n_name_stripped));
- }
- Printf(en, ",");
- if (!Equal(symname_stripped, c_name_stripped)) {
+ if (!Equal(symname_stripped, c_name_stripped))
Printf(ec, " (Renamed from '%s')", SwigType_namestr(c_name_stripped));
- }
+ if (!Equal(n_name_stripped, n_name_decl))
+ Printf(en, " as %s", n_name_decl);
+ if (!Equal(c_name_stripped, c_name_decl))
+ Printf(ec, " as %s", c_name_decl);
+ Printf(en, " ignored,");
Printf(ec, ".");
SWIG_WARN_NODE_BEGIN(n);
if (redefined) {