From 13843b659c67fc909d1f718b372defeefb91efe5 Mon Sep 17 00:00:00 2001 From: Marcelo Matus Date: Thu, 13 Oct 2005 09:20:58 +0000 Subject: add warning for when you define a 'in' typemap but not an explicit 'typecheck' one git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@7645 626c5289-ae23-0410-ae9c-e8d60b6d4f22 --- SWIG/Source/Modules/overload.cxx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/SWIG/Source/Modules/overload.cxx b/SWIG/Source/Modules/overload.cxx index eede49130..459894667 100644 --- a/SWIG/Source/Modules/overload.cxx +++ b/SWIG/Source/Modules/overload.cxx @@ -403,6 +403,13 @@ Swig_overload_dispatch(Node *n, const String_or_char *fmt, int *maxargs) { if (print_typecheck(f, j, pj)) { Printf(f, "if (_v) {\n"); num_braces++; + } + if (!Getattr(pj,"tmap:in:SWIGTYPE") && Getattr(pj,"tmap:typecheck:SWIGTYPE")) { + /* we emit a warning if the argument defines the 'in' typemap, but not the 'typecheck' one */ + Swig_warning(WARN_TYPEMAP_TYPECHECK_UNDEF, Getfile(ni), Getline(ni), + "Overloaded %s(%s) with no explicit typecheck typemap for arg %d of type '%s'\n", + Getattr(n,"name"),ParmList_str_defaultargs(pi), + j+1, SwigType_str(Getattr(pj,"type"),0)); } Parm *pk = Getattr(pj,"tmap:in:next"); if (pk) pj = pk; -- cgit v1.2.1