Added the warning code

WARN_PARSE_REDUNDANT          322

similar to the g++ -Wredundant-decls flag.

This recovers the warnings that now are not been reported by
the original code

   WARN_PARSE_REDEFINED          302

Redundant example:

   int foo(int);
   int foo(int);

Redefined example:

   int foo(int);
   double foo(int);


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5634 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Marcelo Matus 2004-01-15 08:16:53 +00:00
commit 74d6f1eb43
6 changed files with 63 additions and 25 deletions

View file

@ -170,6 +170,7 @@ int are_equivalent_nodes(Node* a, Node* b, int a_inclass)
if (!a_inclass || (Cmp(a_storage,"friend") == 0)) {
/* check declaration */
String *a_decl = (Getattr(a,"decl"));
String *b_decl = (Getattr(b,"decl"));
if (Cmp(a_decl, b_decl) == 0) {
@ -216,8 +217,12 @@ int are_equivalent_nodes(Node* a, Node* b, int a_inclass)
int need_redefined_warn(Node* a, Node* b, int InClass)
{
String *a_storage = Getattr(a,"storage");
String *b_storage = Getattr(b,"storage");
String *a_symname = Getattr(a,"sym:name");
String *b_symname = Getattr(b,"sym:name");
/* always send a warning if a 'rename' is involved */
if ((a_symname && Cmp(a_symname,Getattr(a,"name")))
|| (b_symname && Cmp(b_symname,Getattr(b,"name"))))
return 1;
return !are_equivalent_nodes(a, b, InClass);
}