From 55e7264d438638ed5a317c34ecba53f1488a3e48 Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Tue, 14 Apr 2015 07:34:40 +0100 Subject: [PATCH] Clearer warning message for badly constructed typecheck typemaps --- CHANGES.current | 11 +++++++++++ Doc/Manual/SWIGPlus.html | 9 +++++---- Doc/Manual/Typemaps.html | 2 +- Doc/Manual/Warnings.html | 2 +- Source/Modules/allegrocl.cxx | 4 ++-- Source/Modules/overload.cxx | 4 ++-- Source/Modules/r.cxx | 4 ++-- 7 files changed, 24 insertions(+), 12 deletions(-) diff --git a/CHANGES.current b/CHANGES.current index 8a30babcd..68e64bc17 100644 --- a/CHANGES.current +++ b/CHANGES.current @@ -5,6 +5,17 @@ See the RELEASENOTES file for a summary of changes in each release. Version 3.0.6 (in progress) =========================== +2015-04-14: wsfulton + Clearer warning message for badly constructed typecheck typemaps. For example, was: + + example.i:3: Warning 467: Overloaded foo(int) not supported (no type checking + rule for 'int'). + + Now: + + example.i:3: Warning 467: Overloaded foo(int) not supported (incomplete type checking + rule - no precedence level in typecheck typemap for 'int'). + 2015-04-11: wsfulton [Java] Fix #353 - Linker multiple definition of 'ExceptionMatches' when using directors and multiple modules. diff --git a/Doc/Manual/SWIGPlus.html b/Doc/Manual/SWIGPlus.html index eeca0291c..d138073d9 100644 --- a/Doc/Manual/SWIGPlus.html +++ b/Doc/Manual/SWIGPlus.html @@ -2101,13 +2101,13 @@ Therefore, earlier methods will shadow methods that appear later.

-When wrapping an overloaded function, there is a chance that you will get an error message like this: +When wrapping an overloaded function, there is a chance that you will get a warning message like this:

-example.i:3: Warning 467: Overloaded foo(int) not supported (no type checking
-rule for 'int').
+example.i:3: Warning 467: Overloaded foo(int) not supported (incomplete type checking rule - 
+no precedence level in typecheck typemap for 'int').
 
@@ -2116,7 +2116,8 @@ This error means that the target language module supports overloading, but for some reason there is no type-checking rule that can be used to generate a working dispatch function. The resulting behavior is then undefined. You should report this as a bug to the -SWIG bug tracking database. +SWIG bug tracking database +if this is due to one of the typemaps supplied with SWIG.

diff --git a/Doc/Manual/Typemaps.html b/Doc/Manual/Typemaps.html index b698e2985..5f484531b 100644 --- a/Doc/Manual/Typemaps.html +++ b/Doc/Manual/Typemaps.html @@ -4563,7 +4563,7 @@ then the type is given a precedence higher than any other known precedence level

-example.i:18: Warning 467: Overloaded method foo(int) not supported (no type checking rule for 'int').
+example.i:18: Warning 467: Overloaded method foo(int) not supported (incomplete type checking rule - no precedence level in typecheck typemap for 'int').
 
diff --git a/Doc/Manual/Warnings.html b/Doc/Manual/Warnings.html index fda162615..2336120d3 100644 --- a/Doc/Manual/Warnings.html +++ b/Doc/Manual/Warnings.html @@ -492,7 +492,7 @@ example.i(4) : Syntax error in input(1).
  • 464. Unsupported constant value.
  • 465. Unable to handle type type.
  • 466. Unsupported variable type type. -
  • 467. Overloaded declaration not supported (no type checking rule for 'type') +
  • 467. Overloaded declaration not supported (incomplete type checking rule - no precedence level in typecheck typemap for 'type')
  • 468. No 'throw' typemap defined for exception type type
  • 469. No or improper directorin typemap defined for type
  • 470. Thread/reentrant unsafe wrapping, consider returning by value instead. diff --git a/Source/Modules/allegrocl.cxx b/Source/Modules/allegrocl.cxx index c7d9ff21b..4b2f325ba 100644 --- a/Source/Modules/allegrocl.cxx +++ b/Source/Modules/allegrocl.cxx @@ -1794,12 +1794,12 @@ static List *Swig_overload_rank(Node *n, bool script_lang_wrapping) { String *t2 = Getattr(p2, "tmap:typecheck:precedence"); if ((!t1) && (!nodes[i].error)) { Swig_warning(WARN_TYPEMAP_TYPECHECK, Getfile(nodes[i].n), Getline(nodes[i].n), - "Overloaded method %s not supported (no type checking rule for '%s').\n", + "Overloaded method %s not supported (incomplete type checking rule - no precedence level in typecheck typemap for '%s').\n", Swig_name_decl(nodes[i].n), SwigType_str(Getattr(p1, "type"), 0)); nodes[i].error = 1; } else if ((!t2) && (!nodes[j].error)) { Swig_warning(WARN_TYPEMAP_TYPECHECK, Getfile(nodes[j].n), Getline(nodes[j].n), - "Overloaded method %s not supported (no type checking rule for '%s').\n", + "Overloaded method %s not supported (incomplete type checking rule - no precedence level in typecheck typemap for '%s').\n", Swig_name_decl(nodes[j].n), SwigType_str(Getattr(p2, "type"), 0)); nodes[j].error = 1; } diff --git a/Source/Modules/overload.cxx b/Source/Modules/overload.cxx index e95ef557f..dd3ca4972 100644 --- a/Source/Modules/overload.cxx +++ b/Source/Modules/overload.cxx @@ -158,12 +158,12 @@ List *Swig_overload_rank(Node *n, bool script_lang_wrapping) { String *t2 = Getattr(p2, "tmap:typecheck:precedence"); if ((!t1) && (!nodes[i].error)) { Swig_warning(WARN_TYPEMAP_TYPECHECK, Getfile(nodes[i].n), Getline(nodes[i].n), - "Overloaded method %s not supported (no type checking rule for '%s').\n", + "Overloaded method %s not supported (incomplete type checking rule - no precedence level in typecheck typemap for '%s').\n", Swig_name_decl(nodes[i].n), SwigType_str(Getattr(p1, "type"), 0)); nodes[i].error = 1; } else if ((!t2) && (!nodes[j].error)) { Swig_warning(WARN_TYPEMAP_TYPECHECK, Getfile(nodes[j].n), Getline(nodes[j].n), - "Overloaded method %s not supported (no type checking rule for '%s').\n", + "Overloaded method %s not supported (incomplete type checking rule - no precedence level in typecheck typemap for '%s').\n", Swig_name_decl(nodes[j].n), SwigType_str(Getattr(p2, "type"), 0)); nodes[j].error = 1; } diff --git a/Source/Modules/r.cxx b/Source/Modules/r.cxx index 3befcfbdd..a42ee97a1 100644 --- a/Source/Modules/r.cxx +++ b/Source/Modules/r.cxx @@ -1381,12 +1381,12 @@ List * R::Swig_overload_rank(Node *n, } if ((!t1) && (!nodes[i].error)) { Swig_warning(WARN_TYPEMAP_TYPECHECK, Getfile(nodes[i].n), Getline(nodes[i].n), - "Overloaded method %s not supported (no type checking rule for '%s').\n", + "Overloaded method %s not supported (incomplete type checking rule - no precedence level in typecheck typemap for '%s').\n", Swig_name_decl(nodes[i].n), SwigType_str(Getattr(p1, "type"), 0)); nodes[i].error = 1; } else if ((!t2) && (!nodes[j].error)) { Swig_warning(WARN_TYPEMAP_TYPECHECK, Getfile(nodes[j].n), Getline(nodes[j].n), - "xx Overloaded method %s not supported (no type checking rule for '%s').\n", + "Overloaded method %s not supported (incomplete type checking rule - no precedence level in typecheck typemap for '%s').\n", Swig_name_decl(nodes[j].n), SwigType_str(Getattr(p2, "type"), 0)); nodes[j].error = 1; }