mirror of https://github.com/swig/swig
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
This commit is contained in:
parent
ce6d2dd11e
commit
0b4496a735
|
@ -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"
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 %{
|
||||
|
|
|
@ -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=;
|
||||
|
|
|
@ -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 %{
|
||||
|
|
|
@ -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 %{
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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 <utility>
|
||||
class A {
|
||||
|
|
|
@ -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*/"
|
||||
|
|
|
@ -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 <utility>
|
||||
struct Thing {};
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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 //
|
||||
////////////////////////
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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)" ; \
|
||||
|
|
|
@ -1,6 +1,12 @@
|
|||
%module li_std_string
|
||||
%include <std_string.i>
|
||||
|
||||
#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 }
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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!
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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!
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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!
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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!
|
||||
|
|
|
@ -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
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue