From 0b4496a735721d38d6b44101576f0193ba1c0d85 Mon Sep 17 00:00:00 2001 From: Olly Betts Date: Sat, 20 Jul 2024 07:52:18 +1200 Subject: [PATCH] Fix testsuite SWIG warnings; enable SWIG -Werror SWIG/mzscheme (aka racket) is excluded for now as it currently has a lot of testsuite warnings and is slated for removal in 4.4.0 anyway. Closes #3034 --- CHANGES.current | 5 +++++ Examples/test-suite/c/Makefile.in | 3 +++ Examples/test-suite/constant_directive.i | 7 +++++++ .../test-suite/cpp11_alternate_function_syntax.i | 2 ++ Examples/test-suite/cpp11_assign_rvalue_reference.i | 5 +++++ Examples/test-suite/cpp11_brackets_expression.i | 12 ++++++++++++ Examples/test-suite/cpp11_default_delete.i | 5 +++++ Examples/test-suite/cpp11_move_only.i | 4 +++- Examples/test-suite/cpp11_rvalue_reference.i | 5 +++++ Examples/test-suite/cpp11_rvalue_reference2.i | 5 +++++ Examples/test-suite/cpp11_rvalue_reference3.i | 6 ++++++ Examples/test-suite/cpp11_rvalue_reference_move.i | 4 ++++ .../test-suite/cpp11_template_templated_methods.i | 5 ++++- Examples/test-suite/cpp11_using_constructor.i | 10 ++++++++++ .../test-suite/cpp11_variadic_function_templates.i | 4 ++++ Examples/test-suite/cpp11_variadic_templates.i | 5 +++++ Examples/test-suite/csharp/Makefile.in | 3 +++ Examples/test-suite/d/Makefile.in | 3 +++ Examples/test-suite/go/Makefile.in | 3 +++ Examples/test-suite/guile/Makefile.in | 3 +++ Examples/test-suite/java/Makefile.in | 3 +++ Examples/test-suite/javascript/Makefile.in | 3 +++ Examples/test-suite/li_std_string.i | 6 ++++++ Examples/test-suite/li_std_string_extra.i | 7 +++++++ Examples/test-suite/lua/Makefile.in | 3 +++ Examples/test-suite/mzscheme/Makefile.in | 5 +++++ Examples/test-suite/ocaml/Makefile.in | 4 ++++ Examples/test-suite/octave/Makefile.in | 3 +++ Examples/test-suite/overload_numeric.i | 4 +++- Examples/test-suite/perl5/Makefile.in | 4 +++- Examples/test-suite/php/Makefile.in | 3 +++ Examples/test-suite/python/Makefile.in | 3 +++ Examples/test-suite/r/Makefile.in | 4 +++- Examples/test-suite/ruby/Makefile.in | 3 +++ Examples/test-suite/scilab/Makefile.in | 3 +++ Examples/test-suite/tcl/Makefile.in | 4 +++- Examples/test-suite/using_member.i | 10 ++++++++++ 37 files changed, 165 insertions(+), 6 deletions(-) diff --git a/CHANGES.current b/CHANGES.current index 081a9c059..359d5ac2b 100644 --- a/CHANGES.current +++ b/CHANGES.current @@ -7,6 +7,11 @@ the issue number to the end of the URL: https://github.com/swig/swig/issues/ Version 4.4.0 (in progress) =========================== +2024-10-22: olly + #3034 SWIG's testsuite is now free of SWIG warnings for all target + languages except mzscheme and the SWIG -Werror option is now + enabled automatically to ensure this doesn't regress. + 2024-10-22: olly #2998 Drop support for specifying SWIG's internal type string representation in interface files. This "secret developer feature" diff --git a/Examples/test-suite/c/Makefile.in b/Examples/test-suite/c/Makefile.in index 07901abb8..0105cafcd 100644 --- a/Examples/test-suite/c/Makefile.in +++ b/Examples/test-suite/c/Makefile.in @@ -104,6 +104,9 @@ include $(srcdir)/../common.mk # Overridden variables here +# Ensure testsuite remains free from SWIG warnings. +SWIGOPT += -Werror + # Suppress warnings about experimental status and unsupported features -- there are just too many of those for now for these warnings to be useful. SWIGOPT += -w524 -w761 diff --git a/Examples/test-suite/constant_directive.i b/Examples/test-suite/constant_directive.i index f30123b3f..a30820a94 100644 --- a/Examples/test-suite/constant_directive.i +++ b/Examples/test-suite/constant_directive.i @@ -2,6 +2,13 @@ // %constant and struct +#ifdef SWIGGUILE +// Suppress warnings for constants SWIG/Guile doesn't currently handle. +%warnfilter(SWIGWARN_TYPEMAP_CONST_UNDEF) TYPE1_CONSTANT1; +%warnfilter(SWIGWARN_TYPEMAP_CONST_UNDEF) TYPE1_CONSTANT2; +%warnfilter(SWIGWARN_TYPEMAP_CONST_UNDEF) TYPE1CFPTR1DEF_CONSTANT1; +#endif + #ifdef SWIGOCAML %warnfilter(SWIGWARN_PARSE_KEYWORD) val; #endif diff --git a/Examples/test-suite/cpp11_alternate_function_syntax.i b/Examples/test-suite/cpp11_alternate_function_syntax.i index 2f8d378b8..d8038d153 100644 --- a/Examples/test-suite/cpp11_alternate_function_syntax.i +++ b/Examples/test-suite/cpp11_alternate_function_syntax.i @@ -8,6 +8,8 @@ %ignore addAlternateMemberPtrConstParm(int x, int (SomeStruct::*mp)(int, int) const) const; // SWIG/C doesn't currently support wrapping rvalue reference return types. %ignore SomeStruct::output(short); +#elif defined SWIGGO +%warnfilter(SWIGWARN_LANG_NATIVE_UNIMPL) output_rvalueref; #endif %inline %{ diff --git a/Examples/test-suite/cpp11_assign_rvalue_reference.i b/Examples/test-suite/cpp11_assign_rvalue_reference.i index 82614de3a..b8c9f0e75 100644 --- a/Examples/test-suite/cpp11_assign_rvalue_reference.i +++ b/Examples/test-suite/cpp11_assign_rvalue_reference.i @@ -1,5 +1,10 @@ %module cpp11_assign_rvalue_reference +#if defined SWIGGO +// Several: Warning 507: No Go typemap defined for int && +# pragma SWIG nowarn=SWIGWARN_LANG_NATIVE_UNIMPL +#endif + // Copy of assign_reference.i testcase replacing reference member variables with rvalue reference member variables %rename(Assign) *::operator=; diff --git a/Examples/test-suite/cpp11_brackets_expression.i b/Examples/test-suite/cpp11_brackets_expression.i index 3e739f591..eac9cab97 100644 --- a/Examples/test-suite/cpp11_brackets_expression.i +++ b/Examples/test-suite/cpp11_brackets_expression.i @@ -1,7 +1,19 @@ %module cpp11_brackets_expression +#ifdef SWIGGUILE +// Suppress warnings SWIG/Guile emits because these constants have type size_t +// which we don't show SWIG a definition of. +%warnfilter(SWIGWARN_TYPEMAP_CONST_UNDEF) Piece::kOk2; +%warnfilter(SWIGWARN_TYPEMAP_CONST_UNDEF) Piece::SimpleAsYouExpect123; +%warnfilter(SWIGWARN_TYPEMAP_CONST_UNDEF) Piece::SimpleJust123; +%warnfilter(SWIGWARN_TYPEMAP_CONST_UNDEF) Piece::AsYouExpect123; +%warnfilter(SWIGWARN_PARSE_ASSIGNED_VALUE,SWIGWARN_TYPEMAP_CONST_UNDEF) Piece::kMaxSize; +%warnfilter(SWIGWARN_PARSE_ASSIGNED_VALUE,SWIGWARN_TYPEMAP_CONST_UNDEF) Piece::Just123; +#else %warnfilter(SWIGWARN_PARSE_ASSIGNED_VALUE) Piece::kMaxSize; %warnfilter(SWIGWARN_PARSE_ASSIGNED_VALUE) Piece::Just123; +#endif + %warnfilter(SWIGWARN_PARSE_ASSIGNED_VALUE) ::kMaxSizeGlobal; %inline %{ diff --git a/Examples/test-suite/cpp11_default_delete.i b/Examples/test-suite/cpp11_default_delete.i index 408027c4b..a2957736c 100644 --- a/Examples/test-suite/cpp11_default_delete.i +++ b/Examples/test-suite/cpp11_default_delete.i @@ -4,6 +4,11 @@ %warnfilter(SWIGWARN_LANG_OVERLOAD_IGNORED, SWIGWARN_LANG_OVERLOAD_SHADOW) trivial::trivial(trivial&&); %warnfilter(SWIGWARN_LANG_OVERLOAD_IGNORED, SWIGWARN_LANG_OVERLOAD_SHADOW) trivial::operator =(trivial&&); +#if defined SWIGGO +%warnfilter(SWIGWARN_LANG_NATIVE_UNIMPL) trivial&&; +%warnfilter(SWIGWARN_LANG_NATIVE_UNIMPL) moveonly&&; +#endif + %rename(Assignment) *::operator=; %inline %{ diff --git a/Examples/test-suite/cpp11_move_only.i b/Examples/test-suite/cpp11_move_only.i index 199b4af8c..18029854a 100644 --- a/Examples/test-suite/cpp11_move_only.i +++ b/Examples/test-suite/cpp11_move_only.i @@ -2,7 +2,9 @@ %include "cpp11_move_only_helper.i" -#if defined(SWIGOCAML) +#if defined(SWIGGO) +%warnfilter(SWIGWARN_LANG_NATIVE_UNIMPL) MoveOnly&&; +#elif defined(SWIGOCAML) %rename(valu) val; #endif diff --git a/Examples/test-suite/cpp11_rvalue_reference.i b/Examples/test-suite/cpp11_rvalue_reference.i index 788eb8ce6..78f57c945 100644 --- a/Examples/test-suite/cpp11_rvalue_reference.i +++ b/Examples/test-suite/cpp11_rvalue_reference.i @@ -1,6 +1,11 @@ // This testcase checks whether SWIG correctly parses C++11 rvalue references. %module cpp11_rvalue_reference +#if defined SWIGGO +// Several: Warning 507: No Go typemap defined for int && +# pragma SWIG nowarn=SWIGWARN_LANG_NATIVE_UNIMPL +#endif + %inline %{ #include class A { diff --git a/Examples/test-suite/cpp11_rvalue_reference2.i b/Examples/test-suite/cpp11_rvalue_reference2.i index a3af6daf8..c1f142cf7 100644 --- a/Examples/test-suite/cpp11_rvalue_reference2.i +++ b/Examples/test-suite/cpp11_rvalue_reference2.i @@ -2,6 +2,11 @@ %warnfilter(SWIGWARN_TYPEMAP_SWIGTYPELEAK) globalrrval; +#if defined SWIGGO +// Several: Warning 507: No Go typemap defined for int && +# pragma SWIG nowarn=SWIGWARN_LANG_NATIVE_UNIMPL +#endif + // This testcase tests lots of different places that rvalue reference syntax can be used %typemap(in) Something && "/*in Something && typemap*/" diff --git a/Examples/test-suite/cpp11_rvalue_reference3.i b/Examples/test-suite/cpp11_rvalue_reference3.i index 55a55bac9..5b23a7706 100644 --- a/Examples/test-suite/cpp11_rvalue_reference3.i +++ b/Examples/test-suite/cpp11_rvalue_reference3.i @@ -2,6 +2,12 @@ %warnfilter(SWIGWARN_TYPEMAP_SWIGTYPELEAK); +#if defined SWIGGO +// Several: Warning 507: No Go typemap defined for int && +// and other rvalue reference types +# pragma SWIG nowarn=SWIGWARN_LANG_NATIVE_UNIMPL +#endif + %inline %{ #include struct Thing {}; diff --git a/Examples/test-suite/cpp11_rvalue_reference_move.i b/Examples/test-suite/cpp11_rvalue_reference_move.i index 04cd2b869..060029d44 100644 --- a/Examples/test-suite/cpp11_rvalue_reference_move.i +++ b/Examples/test-suite/cpp11_rvalue_reference_move.i @@ -2,6 +2,10 @@ // Testcase for testing rvalue reference input typemaps which assume the object is moved during a function call +#if defined SWIGGO +%warnfilter(SWIGWARN_LANG_NATIVE_UNIMPL) MovableCopyable&&; +#endif + %include "cpp11_move_only_helper.i" %catches(std::string) MovableCopyable::check_numbers_match; diff --git a/Examples/test-suite/cpp11_template_templated_methods.i b/Examples/test-suite/cpp11_template_templated_methods.i index 39c07b88f..e09f8b7bc 100644 --- a/Examples/test-suite/cpp11_template_templated_methods.i +++ b/Examples/test-suite/cpp11_template_templated_methods.i @@ -3,7 +3,10 @@ // Testing templated methods in a template // Including variadic templated method reported in https://github.com/swig/swig/issues/2794 -#if defined(SWIGLUA) || defined(SWIGOCAML) +#if defined(SWIGGO) +// Several: Warning 507: No Go typemap defined for eprosima::fastrtps::rtps::octet && +# pragma SWIG nowarn=SWIGWARN_LANG_NATIVE_UNIMPL +#elif defined(SWIGLUA) || defined(SWIGOCAML) %rename(end_renamed) end; %rename(begin_renamed) begin; #endif diff --git a/Examples/test-suite/cpp11_using_constructor.i b/Examples/test-suite/cpp11_using_constructor.i index d1dcddb75..74dcbdf23 100644 --- a/Examples/test-suite/cpp11_using_constructor.i +++ b/Examples/test-suite/cpp11_using_constructor.i @@ -2,6 +2,16 @@ // Note: this testcase is also used by cpp11_director_using_constructor.i +#ifdef SWIGLUA +// Lua does now have a separate integer type, but didn't used to +// and SWIG doesn't yet know about it (see #1918) so for now suppress +// warnings about functions with overloads on int vs double, etc. +%warnfilter(SWIGWARN_LANG_OVERLOAD_SHADOW) TemplateConstructor1Base::TemplateConstructor1Base(double,char const *); +%warnfilter(SWIGWARN_LANG_OVERLOAD_SHADOW) TemplateConstructor1Derived::TemplateConstructor1Derived(double,char const *); +%warnfilter(SWIGWARN_LANG_OVERLOAD_SHADOW) TemplateConstructor1Base::TemplateConstructor1Base(double,char const *); +%warnfilter(SWIGWARN_LANG_OVERLOAD_SHADOW) TemplateConstructor1Derived::TemplateConstructor1Derived(double,char const *); +#endif + %inline %{ // Public base constructors struct PublicBase1 { diff --git a/Examples/test-suite/cpp11_variadic_function_templates.i b/Examples/test-suite/cpp11_variadic_function_templates.i index 82836a4f3..f06458eb0 100644 --- a/Examples/test-suite/cpp11_variadic_function_templates.i +++ b/Examples/test-suite/cpp11_variadic_function_templates.i @@ -1,5 +1,9 @@ %module cpp11_variadic_function_templates +#if defined SWIGGO +%warnfilter(SWIGWARN_LANG_NATIVE_UNIMPL) EmplaceContainer::emplace; +#endif + // Some tests for variadic function templates %inline %{ class A { diff --git a/Examples/test-suite/cpp11_variadic_templates.i b/Examples/test-suite/cpp11_variadic_templates.i index dfa8f79a5..7ecebc870 100644 --- a/Examples/test-suite/cpp11_variadic_templates.i +++ b/Examples/test-suite/cpp11_variadic_templates.i @@ -20,6 +20,11 @@ SWIGWARN_PHP_MULTIPLE_INHERITANCE, SWIGWARN_RUBY_MULTIPLE_INHERITANCE) LotsInherit; +#if defined SWIGGO +%warnfilter(SWIGWARN_LANG_NATIVE_UNIMPL) ParmsPtrRValueRef; +%warnfilter(SWIGWARN_LANG_NATIVE_UNIMPL) ParmsRValueRef; +#endif + //////////////////////// // Variadic templates // //////////////////////// diff --git a/Examples/test-suite/csharp/Makefile.in b/Examples/test-suite/csharp/Makefile.in index db9a62448..0c3154476 100644 --- a/Examples/test-suite/csharp/Makefile.in +++ b/Examples/test-suite/csharp/Makefile.in @@ -58,6 +58,9 @@ SWIGOPT += -namespace $*Namespace CSHARPFLAGSSPECIAL = +# Ensure testsuite remains free from SWIG warnings. +SWIGOPT += -Werror + # Custom tests - tests with additional commandline options complextest.cpptest: CSHARPFLAGSSPECIAL = -r:System.Numerics.dll csharp_lib_arrays.cpptest: CSHARPFLAGSSPECIAL = -unsafe diff --git a/Examples/test-suite/d/Makefile.in b/Examples/test-suite/d/Makefile.in index e6670ba89..3c3a86dc3 100644 --- a/Examples/test-suite/d/Makefile.in +++ b/Examples/test-suite/d/Makefile.in @@ -56,6 +56,9 @@ SRCDIR = ../$(srcdir)/ TARGETSUFFIX = _wrap SWIGOPT+=-splitproxy -package $* +# Ensure testsuite remains free from SWIG warnings. +SWIGOPT += -Werror + # Rules for the different types of tests %.cpptest: $(setup) diff --git a/Examples/test-suite/go/Makefile.in b/Examples/test-suite/go/Makefile.in index b2ac72620..5757c991b 100644 --- a/Examples/test-suite/go/Makefile.in +++ b/Examples/test-suite/go/Makefile.in @@ -32,6 +32,9 @@ include $(srcdir)/../common.mk INCLUDES = -I$(abs_top_srcdir)/$(EXAMPLES)/$(TEST_SUITE) +# Ensure testsuite remains free from SWIG warnings. +SWIGOPT += -Werror + .SUFFIXES: .cpptest .ctest .multicpptest # Rules for the different types of tests diff --git a/Examples/test-suite/guile/Makefile.in b/Examples/test-suite/guile/Makefile.in index 2efa6adbe..bfa25acef 100644 --- a/Examples/test-suite/guile/Makefile.in +++ b/Examples/test-suite/guile/Makefile.in @@ -30,6 +30,9 @@ include $(srcdir)/../common.mk # Overridden variables here INCLUDES += -I$(top_srcdir)/$(EXAMPLES)/$(TEST_SUITE)/guile +# Ensure testsuite remains free from SWIG warnings. +SWIGOPT += -Werror + # Custom tests - tests with additional commandline options %.multicpptest: SWIGOPT += $(GUILE_RUNTIME) diff --git a/Examples/test-suite/java/Makefile.in b/Examples/test-suite/java/Makefile.in index ea4caf35f..319833067 100644 --- a/Examples/test-suite/java/Makefile.in +++ b/Examples/test-suite/java/Makefile.in @@ -78,6 +78,9 @@ JAVA_PACKAGE = $* JAVA_PACKAGEOPT = -package $(JAVA_PACKAGE) SWIGOPT += $(JAVA_PACKAGEOPT) +# Ensure testsuite remains free from SWIG warnings. +SWIGOPT += -Werror + # Custom tests - tests with additional commandline options cpp17_nspace_nested_namespaces.%: JAVA_PACKAGE = $*Package director_nspace.%: JAVA_PACKAGE = $*Package diff --git a/Examples/test-suite/javascript/Makefile.in b/Examples/test-suite/javascript/Makefile.in index 0b1fb0641..e8692e5bf 100644 --- a/Examples/test-suite/javascript/Makefile.in +++ b/Examples/test-suite/javascript/Makefile.in @@ -55,6 +55,9 @@ endif include $(srcdir)/../common.mk +# Ensure testsuite remains free from SWIG warnings. +SWIGOPT += -Werror + _setup = \ if [ -f $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) ]; then \ $(ECHO_PROGRESS) "$(ACTION)ing $(LANGUAGE) ($(JSENGINE)) testcase $* (with run test)" ; \ diff --git a/Examples/test-suite/li_std_string.i b/Examples/test-suite/li_std_string.i index 97517df79..224e68db7 100644 --- a/Examples/test-suite/li_std_string.i +++ b/Examples/test-suite/li_std_string.i @@ -1,6 +1,12 @@ %module li_std_string %include +#ifdef SWIGGUILE +// Suppress warnings for constants SWIG/Guile doesn't currently handle. +%warnfilter(SWIGWARN_TYPEMAP_CONST_UNDEF) MY_STRING; +%warnfilter(SWIGWARN_TYPEMAP_CONST_UNDEF) MY_STRING_2; +#endif + #if defined(SWIGLUA) || defined(SWIGPHP) || defined(SWIGUTL) %apply std::string& INPUT { std::string &input } %apply std::string& INOUT { std::string &inout } diff --git a/Examples/test-suite/li_std_string_extra.i b/Examples/test-suite/li_std_string_extra.i index 1fc2225ca..6e5bdff94 100644 --- a/Examples/test-suite/li_std_string_extra.i +++ b/Examples/test-suite/li_std_string_extra.i @@ -1,5 +1,12 @@ %module li_std_string_extra +#if defined SWIGSCILAB +// Not sure what's going on here but we get: +// .././../li_std_string_extra.i:12: Warning 402: Base class 'std::string' is incomplete. +// ../../../../Lib/typemaps/std_string.swg:16: Warning 402: Only forward declaration 'std::string' was found. +%warnfilter(SWIGWARN_TYPE_INCOMPLETE) A; +#endif + %naturalvar A; diff --git a/Examples/test-suite/lua/Makefile.in b/Examples/test-suite/lua/Makefile.in index af6735101..43f04fe01 100644 --- a/Examples/test-suite/lua/Makefile.in +++ b/Examples/test-suite/lua/Makefile.in @@ -31,6 +31,9 @@ include $(srcdir)/../common.mk # Overridden variables here LIBS = -L. +# Ensure testsuite remains free from SWIG warnings. +SWIGOPT += -Werror + # Custom tests - tests with additional commandline options lua_no_module_global.%: SWIGOPT += -nomoduleglobal diff --git a/Examples/test-suite/mzscheme/Makefile.in b/Examples/test-suite/mzscheme/Makefile.in index 212379ca8..acbf44476 100644 --- a/Examples/test-suite/mzscheme/Makefile.in +++ b/Examples/test-suite/mzscheme/Makefile.in @@ -84,6 +84,11 @@ include $(srcdir)/../common.mk # Overridden variables here SWIGOPT += -w524 # Suppress SWIGWARN_LANG_EXPERIMENTAL warning +# Ensure testsuite remains free from SWIG warnings. +# Currently there are a lot of SWIG warnings for mzscheme, but it is marked +# as "Experimental" and slated for removal in 4.4.0 (#2830). +#SWIGOPT += -Werror + # Custom tests - tests with additional commandline options # none! diff --git a/Examples/test-suite/ocaml/Makefile.in b/Examples/test-suite/ocaml/Makefile.in index 275f8e499..7c3eb81ce 100644 --- a/Examples/test-suite/ocaml/Makefile.in +++ b/Examples/test-suite/ocaml/Makefile.in @@ -58,6 +58,10 @@ run_testcase = \ include $(srcdir)/../common.mk # Overridden variables here + +# Ensure testsuite remains free from SWIG warnings. +SWIGOPT += -Werror + SWIGOPT += -w524 # Suppress SWIGWARN_LANG_EXPERIMENTAL warning # Custom tests - tests with additional commandline options diff --git a/Examples/test-suite/octave/Makefile.in b/Examples/test-suite/octave/Makefile.in index 091e4c990..d3aa6dbf5 100644 --- a/Examples/test-suite/octave/Makefile.in +++ b/Examples/test-suite/octave/Makefile.in @@ -34,6 +34,9 @@ include $(srcdir)/../common.mk LIBS = -L. CSRCS = octave_empty.c +# Ensure testsuite remains free from SWIG warnings. +SWIGOPT += -Werror + # Custom tests - tests with additional commandline options # none! diff --git a/Examples/test-suite/overload_numeric.i b/Examples/test-suite/overload_numeric.i index 44c3b811c..deba78409 100644 --- a/Examples/test-suite/overload_numeric.i +++ b/Examples/test-suite/overload_numeric.i @@ -3,8 +3,10 @@ // Tests overloading of integral and floating point types to verify the range checking required // for dispatch to the correct overloaded method -#ifdef SWIGLUA +#if defined SWIGGUILE || defined SWIGLUA || defined SWIGR +// Guile seems to only have one integer type and one floating point type. // lua only has one numeric type, so most of the overloads shadow each other creating warnings +// R seems to only have one integer type. %warnfilter(SWIGWARN_LANG_OVERLOAD_SHADOW) Nums::over; #endif diff --git a/Examples/test-suite/perl5/Makefile.in b/Examples/test-suite/perl5/Makefile.in index 43c30ed15..34947ecf7 100644 --- a/Examples/test-suite/perl5/Makefile.in +++ b/Examples/test-suite/perl5/Makefile.in @@ -34,7 +34,9 @@ C_TEST_CASES += \ include $(srcdir)/../common.mk # Overridden variables here -# none! + +# Ensure testsuite remains free from SWIG warnings. +SWIGOPT += -Werror # Custom tests - tests with additional commandline options cpp11_strongly_typed_enumerations_perl_const.cpptest: SWIGOPT += -const diff --git a/Examples/test-suite/php/Makefile.in b/Examples/test-suite/php/Makefile.in index 35794e944..925860879 100644 --- a/Examples/test-suite/php/Makefile.in +++ b/Examples/test-suite/php/Makefile.in @@ -33,6 +33,9 @@ include $(srcdir)/../common.mk # Overridden variables here TARGETPREFIX =# Should be php_ for Windows, empty otherwise +# Ensure testsuite remains free from SWIG warnings. +SWIGOPT += -Werror + # Custom tests - tests with additional commandline options prefix.cpptest: SWIGOPT += -prefix Project diff --git a/Examples/test-suite/python/Makefile.in b/Examples/test-suite/python/Makefile.in index 132ef70cd..1b401c956 100644 --- a/Examples/test-suite/python/Makefile.in +++ b/Examples/test-suite/python/Makefile.in @@ -120,6 +120,9 @@ include $(srcdir)/../common.mk LIBS = -L. VALGRIND_OPT += --suppressions=pythonswig.supp +# Ensure testsuite remains free from SWIG warnings. +SWIGOPT += -Werror + # Custom tests - tests with additional commandline options python_flatstaticmethod.cpptest: SWIGOPT += -flatstaticmethod diff --git a/Examples/test-suite/r/Makefile.in b/Examples/test-suite/r/Makefile.in index b2716bac5..33bfd2edf 100644 --- a/Examples/test-suite/r/Makefile.in +++ b/Examples/test-suite/r/Makefile.in @@ -30,7 +30,9 @@ CPP_TEST_CASES += \ include $(srcdir)/../common.mk # Overridden variables here -# none! + +# Ensure testsuite remains free from SWIG warnings. +SWIGOPT += -Werror # Custom tests - tests with additional commandline options # none! diff --git a/Examples/test-suite/ruby/Makefile.in b/Examples/test-suite/ruby/Makefile.in index 20ed68c65..89bf3d62a 100644 --- a/Examples/test-suite/ruby/Makefile.in +++ b/Examples/test-suite/ruby/Makefile.in @@ -66,6 +66,9 @@ include $(srcdir)/../common.mk # Overridden variables here SWIGOPT += -w801 -noautorename -features autodoc=4 +# Ensure testsuite remains free from SWIG warnings. +SWIGOPT += -Werror + # Custom tests - tests with additional commandline options ruby_alias_global_function.ctest: SWIGOPT += -globalmodule ruby_global_immutable_vars.ctest: SWIGOPT += -globalmodule diff --git a/Examples/test-suite/scilab/Makefile.in b/Examples/test-suite/scilab/Makefile.in index 55b9984e0..1783f7d53 100644 --- a/Examples/test-suite/scilab/Makefile.in +++ b/Examples/test-suite/scilab/Makefile.in @@ -35,6 +35,9 @@ include $(srcdir)/../common.mk # Overridden variables SRCDIR = ../$(srcdir)/ +# Ensure testsuite remains free from SWIG warnings. +SWIGOPT += -Werror + # Local variables TEST_DIR = $*.dir RUNME_SCRIPT = $(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) diff --git a/Examples/test-suite/tcl/Makefile.in b/Examples/test-suite/tcl/Makefile.in index db8eaa874..8ed832c25 100644 --- a/Examples/test-suite/tcl/Makefile.in +++ b/Examples/test-suite/tcl/Makefile.in @@ -26,7 +26,9 @@ C_TEST_CASES += \ include $(srcdir)/../common.mk # Overridden variables here -# none! + +# Ensure testsuite remains free from SWIG warnings. +SWIGOPT += -Werror # Custom tests - tests with additional commandline options # none! diff --git a/Examples/test-suite/using_member.i b/Examples/test-suite/using_member.i index c80a83a50..e65e756db 100644 --- a/Examples/test-suite/using_member.i +++ b/Examples/test-suite/using_member.i @@ -9,6 +9,16 @@ %rename(greater) one::DD::great; %rename(greaterstill) one::DD::great(bool); +#ifdef SWIGLUA +// Lua does now have a separate integer type, but didn't used to +// and SWIG doesn't yet know about it (see #1918) so for now suppress +// warnings about functions with overloads on int vs double, etc. +%warnfilter(SWIGWARN_LANG_OVERLOAD_SHADOW) B::get(double); +%warnfilter(SWIGWARN_LANG_OVERLOAD_SHADOW) one::two::three::interface1::AA::great(float); +%warnfilter(SWIGWARN_LANG_OVERLOAD_SHADOW) one::CC::great; +%warnfilter(SWIGWARN_LANG_OVERLOAD_SHADOW) one::DD::great(float); +#endif + %inline %{ namespace interface1 {