Below are the changes for the current release. See the CHANGES file for changes in older releases. See the RELEASENOTES file for a summary of changes in each release. Issue # numbers mentioned below can be found on Github. For more details, add the issue number to the end of the URL: https://github.com/swig/swig/issues/ Version 4.4.0 (20 Oct 2025) =========================== 2025-10-19: phetdam [Python] #3286 Update docs for using setuptools instead of distutils. Improve docs for the -M family of options for dependency file generation. 2025-10-15: pertusus Fix some -Wstrict-prototypes warnings. 2025-10-02: wsfulton [Python] #3189 Modify StopIteration implementation for it to work across multiple modules. 2025-10-02: wsfulton [Python] Fix out typemaps for PyObject * to correctly handle NULL return. NULL is used as the return value for indicating that a Python exception has been raised. Previously C Python API code could have been called, but now execution is immediately returned to the Python interpreter. 2025-09-01: AnnaAraslanova [Python] #3254 Bug fix - mark modules as no-gil compatible only when -nogil flag is used. 2025-08-27: olly [PHP] Fix unused label warnings (-Wunused-label in GCC and clang). 2025-08-18: greyshepherd-star [C#] #3248 Fix potential null poiner deref calling equals method in std::list. 2025-08-13: olly, jim-easterbrook [Python] #2786 Fix handling of "default" typemap applied to method which takes a single argument when "-builtin" option is used. 2025-08-13: crusaderky [Python] #3235 Free-threaded race condition fix in SWIG_TypeQuery. 2025-08-11: erezgeva #3238 Add typecheck typemaps for adding in overloading support to the (size_t LENGTH, char *STRING) and (char *STRING, size_t LENGTH) family of multi-argument typemaps. 2025-08-11: erezgeva, wsfulton [D] #3236 Add missing use of 'din' typemap in constructors. 2025-08-11: QuantamHD [Tcl] #3246 Fix memory leak in constant registration. 2025-08-08: crusaderky [Python] #3230 SWIG_AsArgcArgv memory fixes and thread-safety fixes for free-threading Python. 2025-08-01: erezgeva [D] #3234 Ensure 'dtype' multi-argument typemaps are being correctly used. 2025-07-28: erezgeva #2937 Add missing support for (size_t LENGTH, char *STRING) multi-argument typemaps. 2025-07-23: jim-easterbrook [Python] #3218 Added weakref support to builtin wrappers. 2025-07-18: crusaderky [Python] #3215 Added -nogil flag to mark modules as free-threading compatible. 2025-07-18: jim-easterbrook [Python] #3219 Python builtin heap types buffer support via the "python:bf_getbuffer" and "python:bf_releasebuffer" features improvement. Add workarounds/fixes for python-3.9 and earlier and ignore when using the limited API for versions prior to python-3.11 instead of generating code that won't compile. 2025-07-09: timfel [Python] #3217 Fix undefined behaviour in SwigPyObject_richcompare and SwigPyObject_compare. 2025-07-04: wsfulton [Python] #3260 Remove unused, out of date SWIG_Python_TypeError method. This support function designed for typemaps stopped being used within SWIG typemaps 20 years ago. Any users still relying on it have a few options which are outlined in #3260. 2025-06-27: wsfulton [Python] Raise an AttributeError instead of TypeError when there are internal and unexpected coding errors around member variable wrappers. 2025-06-27: jim-easterbrook [Python] #3206 Fix seg fault or return without exception error when attempting to delete (del) a wrapped member variable (builtin wrappers). This will now raise an AttributeError. 2025-06-27: ianlancetaylor [Go] Use unsafe for Go strings rather than byte arrays. Update minimum Go supported version to 1.20. 2025-06-23: jschueller [Python] #3184 #3196 Support multi-phase module initialization. 2025-06-23: wsfulton Fix numerous unused variable warnings (-Wunused-variable in gcc). 2025-06-20: wsfulton [Python] #3196 Heap types are now generated by default instead of static types for the builtin wrappers. Defining SWIG_HEAPTYPES to use heap types is no longer required. 2025-06-18: wsfulton [Python] #3196 Add support for -builtin and heap types turned on with -DSWIG_HEAPTYPES. This is an important step towards supporting a number of modern Python wrapper features including Py_LIMITED_API (Stable ABI compliance), and sharing types between interpreters. 2025-06-17: olly #3197 Improve parsing of expressions related to functions calls and/or member access. For example, the following no longer give parse errors: `g().d()`, `g().D`, `a::b.c()`, `x::y.z`, `(f(1) < g(2))`, `sizeof f(a,b)` 2025-06-11: wsfulton Remove pyname_compat.i file providing legacy names which changed in swig-1.3.37 and script Tools/pyname_patch.py which helped rename uses in user interface files. 2025-06-09: tvlEIVA [Javascript] #3138 Use SetNativeDataProperty() instead of SetAccessor() which fixes compatibility with recent v8 versions. 2025-06-09: olly The $function variable in %exception/feature:except typemaps is no longer recognised. It was marked as deprecated in 2008. Use $action (added in 2001) instead which has exactly the same value. SWIG/D has an unrelated $function variable which is substituted in %pragma(d) wrapperloaderbindcommand - this is still supported. 2025-06-09: olly [Python] #3162 Fix wrapping of a bool const& parameter with a default value. Regression introduced in SWIG 4.3.0. 2025-06-09: olly [Tcl] #2887 Fix -external-runtime to generate a header which works with Tcl 8.x. Regression introduced in SWIG 4.2.1. As a bonus the generated header no longer requires the user to include tcl.h and various standard C library headers before including it. 2025-05-28: olly #3186 Fix parse error for C++14 forward declaration of function with auto return type and no trailing return type. 2025-05-19: jschueller [Python] #3059 Use new buffer protocol for PY_LIMITED_API for python-3.11 and later since this is when it was added to the stable ABI, noting that the old buffer protocol was removed in python-3.13. 2025-05-16: wsfulton #3179 Fix a regression using -kwargs since swig-4.1 in template expansion of function parameter values. 2025-05-13: wsfulton Fix undefined behaviour in directorout typemaps for void * and const char *& if the same wrapped function is called more than once. Note that using returning pointers in directors is still full of traps and not recommended. As such, warning SWIGWARN_TYPEMAP_DIRECTOROUT_PTR (473) continues to be issued. 2025-05-11: wsfulton [Python] Move the SwigPyObject, SwigPyPacked, SwigVarLink (renamed from swigvarlink) support Python types to the SWIG runtime module (currently called swig_runtime_data5). Note that these affect the Python runtime implementation, so the recently bumped SWIG_RUNTIME_VERSION to 5 for all scripting languages will now include this change. 2025-05-10: jschueller, wsfulton [Python] #2881 #3061 #3160 DeprecationWarning fixes when using 'python -Walways' or if using one of the types being warned about: DeprecationWarning: builtin type SwigPyPacked has no __module__ attribute DeprecationWarning: builtin type SwigPyObject has no __module__ attribute DeprecationWarning: builtin type swigvarlink has no __module__ attribute The warning was present if code was generated without using -builtin in 4.3.x. The warning was only present if using the Python limited API in 4.2.1 and earlier. 2025-04-30: wsfulton [Python] #3134 Fix maximum size of strings being marshalled from C/C++ into Python. This has been changed from INT_MAX to PY_SSIZE_T_MAX in line with the Python C API maximum string length handling change in python-2.5. Similarly for the number of elements in the Python STL container wrappers. 2025-04-29: r-barnes, wsfulton #3027 Remove generation of empty dynamic exception specifications - throw(), which are deprecated in c++11. This was only when using the director feature. A new macro SWIG_NOEXCEPT is used which ensures that throw() or noexcept is used for the appropriate C++ standard that the compiler is compiling for. 2025-04-28: jschueller, henryiii [Python] #2967 Use __spec__.parent as the first approach to obtaining a module's package name when importing the low-level C/C++ module as the previous approach looking for __package__ is due to be removed in python-3.15. __package__ is now used as a fallback if __spec__.parent fails. 2025-04-28: jschueller, henryiii [Python] #3066 #3159 Add ht_token slot for python-3.14 support. 2025-04-18: akorobka #103 Thread safety bugfix in the runtime type system. Replaces the casting linked list with a list of arrays that does not get modified at runtime. The content of the cast arrays is sorted during the initialization so that subsequent lookups can use binary search over the entries obtaining O(log n) performance. Bump SWIG_RUNTIME_VERSION to 5 due to associated changes in runtime type system. *** POTENTIAL INCOMPATIBILITY *** 2025-04-17: klausspanderen [Python] #3137 Add support for free threading Python (aka no-gil) where the GIL can be disabled. 2025-04-02: wsfulton [Java] #3156 Support JDK 21 and std::list. Fixes removeFirst() and removeLast() incompatibilities with methods of the same name in the base class, AbstractSequentialList, which were added in JDK 21 with a different return type. The addFirst() and addLast() methods were also added, all part of JEP-431 Sequenced Collections, see https://openjdk.org/jeps/431. If these 4 methods are needed, as SWIG previously generated them, then add the following to your interface file after %include : %extend std::list { void removeLast() { $self->pop_back(); } void removeFirst() { $self->pop_front(); } void addLast(const T &value) { $self->push_back(value); } void addFirst(const T &value) { $self->push_front(value); } } But note that this will give javac compiler errors when using JDK 21 and later for removeFirst() and removeLast(). 2025-04-02: wsfulton [Java] Fix javac -Xlint warning [this-escape] - JDK 21 [this-escape] possible 'this' escape before subclass is fully initialized Add @WarningSuppressions("this-escape") annotation to all director constructors as the warning is a false positive. Similarly for std::list, std::vector, std::set, std::unordered_set constructors. 2025-04-02: wsfulton [Java] Fix javac -Xlint warnings: - [cast] redundant cast in std::unordered_map wrappers put method - [rawtypes] found raw type in std::list constructor wrapper 2025-04-02: olly #3152 Remove typemaps for `signed wchar_t` and `unsigned wchar_t` in C++ mode. These types aren't specified by the C++ standard and give an error with modern versions of GCC, clang or MSVC. Older GCC and clang did allow them (tested with GCC 8 and clang 8), but our typemap code used `UWCHAR_MAX` which doesn't seem to have ever been defined by any compiler. 2025-04-01: olly [MzScheme/Racket] #920 #2830 Remove support for MzScheme/Racket. It's a long time since SWIG's support was actively maintained and a major overhaul would be needed to support Racket 8, for which nobody has stepped forward in over 3 years. 2025-03-03: olly [Guile] The typemaps in ports.i now generate code which compiles even if the wrapper is compiled with in a strict standards conformance mode such as -std=c11. 2025-02-28: olly #3127 Fix bad generated code in some cases when a constant expression is split over multiple lines and used as part of a type. This manifested in cases where SWIG's parser gets the expression text by skipping to the matching closing parenthesis and grabbing the skipped program text. 2025-02-19: wsfulton Add support for $n special variable expansion in the names of typemap local variables, such as: %typemap(in) int MYINT (int $1_temp) { ... } $1_temp is typically expanded to arg1_temp, arg2_temp etc depending on which argument the typemap is applied to. 2025-02-05: wsfulton #3075 Regression fix when using -keyword, kwargs or compactdefaultargs option. Restore generating a non-const cast to the default value when wrapping const pointer default arguments. 2024-12-07: arbrauns [Lua] #3083 Fix "unsigned long long" being interpreted as "signed long long". 2024-11-22: wsfulton Use new fragment for including this header when needed instead of either always including it or relying on it being included elsewhere. Fixes the removal of errno.h when defining PY_LIMITED_API for python-3.11 and later. 2024-11-09: wsfulton #3064 Perform repeated typedef lookups instead of a single typedef lookup on the type being applied in %apply when looking for a family of typemaps to apply. 2024-11-01: wsfulton Fix internal error handling parameters that are typedefs to references when using the compactdefaultargs feature. 2024-10-30: wsfulton #1851 Fix handling of parameters with default arguments that are initializer lists when using -keyword or the compactdefaultargs option. 2024-10-25: olly [Guile] Allow wrapping anything with a `varout` typemap as a constant. 2024-10-24: olly [Perl] https://sourceforge.net/p/swig/bugs/1134/ Ensure C++ local variables get destroyed before throwing a Perl exception. 2024-10-22: olly #3034 SWIG's testsuite is now free of SWIG warnings for all target languages 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" was only documented in developer documentation, and had no test coverage. It allowed specifying an SWIG internal syntax type string, e.g.: `p.a(10).p.f(int, p.f(int).int)` foo(int, int (*x)(int)); In the unlikely event that anyone was using this, we recommend you use the standard C/C++ type syntax instead, which will work with previous SWIG releases too, e.g.: (*(*foo(int, int (*)(int)))[10])(int, int (*)(int)); The C/C++ syntax has the major advantage of being the same syntax that C/C++ compilers use.