Swig

Latest version: v4.2.1

Safety actively analyzes 638466 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 3 of 13

3.0.7

==========================

2015-08-02: wsfulton
[Java] Fix potential security exploit in generated Java classes.
The swigCPtr and swigCMemOwn member variables in the generated Java
classes are now declared 'transient' by default. Further details of the exploit
in Android is being published in an academic paper as part of USENIX WOOT '15:
https://www.usenix.org/conference/woot15/workshop-program/presentation/peles.

In the unlikely event that you are relying on these members being serializable,
then you will need to override the default javabody and javabody_derived typemaps
to generate the old generated code. The relevant typemaps are in the Lib directory
in the java.swg, boost_shared_ptr.i and boost_intrusive_ptr.i files. Copy the
relevant default typemaps into your interface file and remove the 'transient' keyword.

*** POTENTIAL INCOMPATIBILITY ***

2015-08-01: vadz
Make configure --without-alllang option more useful: it can now be overridden by the following
--with-xxx options, allowing to easily enable just one or two languages.

2015-07-30: wsfulton
Fix 440 - Initialise all newly created arrays when using %array_functions and %array_class
in the carrays.i library - bug is only relevant when using C++.

2015-07-29: wsfulton
[Python] Improve indentation warning and error messages for code in the following directives:

%pythonprepend
%pythonappend
%pythoncode
%pythonbegin
%feature("shadow")

Old error example:
Error: Line indented less than expected (line 3 of pythoncode)

New error example:
Error: Line indented less than expected (line 3 of %pythoncode or %insert("python") block)
as no line should be indented less than the indentation in line 1

Old warning example:
Warning 740: Whitespace prefix doesn't match (line 2 of %pythoncode or %insert("python") block)

New warning example:
Warning 740: Whitespace indentation is inconsistent compared to earlier lines (line 3 of
%pythoncode or %insert("python") block)


2015-07-28: wsfulton
[Python] Fix 475. Improve docstring indentation handling.

SWIG-3.0.5 and earlier sometimes truncated text provided in the docstring feature.
This occurred when the indentation (whitespace) in the docstring was less in the
second or later lines when compared to the first line.
SWIG-3.0.6 gave a 'Line indented less than expected' error instead of truncating
the docstring text.
Now the indentation for the 'docstring' feature is smarter and is appropriately
adjusted so that no truncation occurs.

2015-07-22: wsfulton
Support for special variable expansion in typemap attributes. Example usage expansion
in the 'out' attribute (C specific):

%typemap(ctype, out="$*1_ltype") unsigned int& "$*1_ltype"

is equivalent to the following as $*1_ltype expands to 'unsigned int':

%typemap(ctype, out="unsigned int") unsigned int& "unsigned int"

Special variables can be used within special variable macros too. Example usage expansion:

%typemap(cstype) unsigned int "uint"
%typemap(cstype, out="$typemap(cstype, $*1_ltype)") unsigned int& "$typemap(cstype, $*1_ltype)"

Special variables are expanded first and hence the above is equivalent to:

%typemap(cstype, out="$typemap(cstype, unsigned int)") unsigned int& "$typemap(cstype, unsigned int)"

which then expands to:

%typemap(cstype, out="uint") unsigned int& "uint"

2015-07-22: lindleyf
Apply patch 439 - support for $typemap() (aka embedded typemaps or special variable
macros) in typemap attributes. A simple example where $typemap() is expanded in the
'out' attribute (C specific):

%typemap(cstype) unsigned int "uint"
%typemap(cstype, out="$typemap(cstype, unsigned int)") unsigned int& "$typemap(cstype, unsigned int)"

is equivalent to:

%typemap(cstype, out="uint") unsigned int& "uint"

2015-07-18: m7thon
[Python] Docstrings provided via %feature("docstring") are now quoted and added to
the tp_doc slot when using python builtin classes (-builtin). When no docstring is
provided, the tp_doc slot is set to the fully qualified C/C++ class name.
Github issues 445 and 461.

2015-07-17: kwwette
[octave] Support Octave version 4.0.0 (thanks to patches from Orion Poplawski).

2015-07-07: wsfulton
SWIG no longer generates a wrapper for a class' constructor if that class has
any base class with a private destructor. This is because your compiler should
not allow a class to be instantiated if a base has a private destructor. Some
compilers do, so if you need the old behaviour, use the "notabstract" feature, eg:

%feature("notabstract") Derived;
class Base {
~Base() {}
};
struct Derived : Base {};

3.0.6

Not secure
==========================

2015-07-02: wsfulton
Fix syntax error when the template keyword is used in types, eg:

std::template vector<int> v;

2015-07-02: ngladitz
[Lua] Push characters as unformatted 1-character strings to avoid
unprintable characters such as (char)127 being converted to
"<\127>" with Lua 5.3 and later. (github PR 452)

2015-06-29: olly
[Python] Improve handling of whitespace in %pythoncode.

Previously SWIG looked at the indentation of the first line and
removed that many characters from each subsequent line, regardless
of what those characters were. This was made worse because SWIG's
preprocessor removes any whitespace before a ''. Fixes github
issue 379, reported by Joe Orton.

2015-06-12: wsfulton
[R] Fix 430 - call to SWIG_createNewRef in copyToC was incorrectly named.

2015-06-11: sghirate
[C] Patch 427 adds in new command line option -outfile to combine all the
generated C code into a single file.

2015-06-09: wsfulton
Fix seg fault processing C++11 type aliasing. Issue 424.

2015-05-28: wsfulton
[Python] Add new feature "python:cdefaultargs" to control default argument
code generation. By default, SWIG attempts to convert C/C++ default argument values
into Python values and generates code into the Python layer with these values.
Recent versions of SWIG are able to convert more of these values, however, the
new behaviour can be circumvented if desired via this new feature, such that
the default argument values are obtained from the C layer and not the Python layer.
For example:

struct CDA {
int fff(int a = 1, bool b = false);
};

The default code generation in the Python layer is:

class CDA(_object):
...
def fff(self, a=1, b=False):
return _default_args.CDA_fff(self, a, b)

Adding the feature:

%feature("python:cdefaultargs") CDA::fff;

Results in:

class CDA(_object):
...
def fff(self, *args):
return _default_args.CDA_fff(self, *args)

Some code generation modes, eg -builtin and -fastproxy, are unaffected by this as
the default values are always obtained from the C layer.

2015-05-27: wsfulton
[Python] Deal with an integer as the default value of a typedef to bool
parameter in the C++ prototype. See 327. Regression from 3.0.0 onwards.

2015-05-19: olly
[Python] Fix warning when compiling generated code with MSVC.
(Fixes https://sourceforge.net/p/swig/patches/351/ reported by
Mateusz Szyma�ski).

2015-05-14: wsfulton
Fix seg fault wrapping shared_ptr of classes with private constructors and destructors.
This also fixes the "unref" feature when used on classes with private destructors.

2015-05-10: wsfulton
[Java] Fix multi-argument typemaps (char *STRING, size_t LENGTH)
so that they can be applied to a wider range of types. Fixes 385.

2015-05-07: olly
[Python] Deal with an integer as the default value of a bool
parameter in the C++ prototype. Fixes github 327, reported by
Greg Allen.

2015-05-07: LindleyF
[Java] Allow feature("director") and feature("ref") to be used
together. Github PR403.

2015-05-05: olly
Suppress warning 325 "Nested class not currently supported (Foo
ignored)" when Foo has already been explicitly ignored with "%ignore".

2015-05-04: wsfulton
Add support for friend templates, including operator overloading - fixes 196. Considering
the example below, previously the operator gave a syntax error and friendfunc incorrectly
warned with:

"Warning 503: Can't wrap 'friendfunc<(Type)>' unless renamed to a valid identifier."

template <class Type> class MyClass {
friend int friendfunc <Type>(double is, MyClass <Type> & x);
friend int operator<< <Type>(double un, const MyClass <Type> &x);
};

The following also previously incorrectly warned with:

"Warning 302: Identifier 'template_friend' redefined (ignored),"

template<typename T> T template_friend(T);
struct MyTemplate {
template<typename T> friend T template_friend(T);
};

2015-05-01: wsfulton
Fix handling of conversion operators where the operator is split over multiple
lines or has comments within the operator type. Fixes 401.

Also fix similar problem with normal operators which gave a syntax error if split over
multiple lines or had a comment within the operator declaration.

2015-04-30: olly
Ignore unknown preprocessor directives which are inside an inactive
conditional (github issue 394, reported by Dan Wilcox).
Regression introduced in 3.0.3.

2015-04-27: vadz
[Python] Fix "default" typemap used after an argument with "numinputs=0" (377).

2015-04-24: wsfulton
[Python] Fix 256. Code generated with '-builtin -modernargs' segfaults for any
method taking zero arguments.

Also fixes: "SystemError: error return without exception set" during error checking
when using just -builtin and the incorrect number of arguments is passed to a class
method expecting zero arguments.

2015-04-23: wsfulton
[Java] Bug 386 - Memory leak fix in (char *STRING, size_t LENGTH) typemaps.

2015-04-23: vadz
[Python] Make "default" typemap work again (330, 377).

2015-04-23: vadz
[Python] Fix the use of default values for the pointer types (365, 376).

2015-04-23: wsfulton
Fix 'make check-ccache' which is part of 'make check' when one of the CCACHE_
environment variables, for example CCACHE_DISABLE, is set.

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.

2015-04-11: wsfulton
Merge 320 - Make __dict__ accessible for Python builtin classes.

2015-04-07: wsfulton
Fix 375 - parsing of extern "C" and typedef for example:
extern "C" typedef void (*Hook2_t)(int, const char *);
extern "C" typedef int Integer;

2015-03-12: olly
-DSWIG_DIRECTOR_STATIC is now supported for all languages with
director support, not only Python and PHP.

2015-03-02: ianlancetaylor
[Go] Add -cgo option, required for Go versions 1.5 and
later.

2015-02-26: olly
Fix segmentation fault when top==NULL, introduced by nested class
handling (reported in issue346 by Pawe� Tomulik).

2015-02-09: wsfulton
[Guile] Fix generated code for static const char member variables when
defined and declared inline.

2015-02-09: mishas
[Go] Fix %import of files in sub directories.

2015-02-05: ianlancetaylor
[Go] Ignore Go specific type maps (goin, goout, etc.) if they are empty.

2015-02-05: ianlancetaylor
[Go] Generated Go code no longer calls _swig_goallocate or
_swig_makegostring, as they will no longer work as of Go 1.5.

3.0.5

===========================

2015-01-30: wsfulton
[Python] Fix Python -classic and property setting. Setting properties on classic classes
was broken in swig-3.0.3 by attempting to use __setattr__. This regression is fixed now
by using __dict__ again when using -classic.
Fixes patch 232.

2015-01-27: smarchetto
[Scilab] Support for the Scilab language has been added

2015-01-23: olly
[PHP] When wrapping a returned resource as an object, check if all
cases wrap it in the same class, and if so eliminate the pointless
switch statement wrapper we previously generated.

2015-01-22: wsfulton
[Octave] Merge patch 297 for SF bug 1277 - Octave shared_ptr support

2015-01-15: wsfulton
[Python] Merge patch 250 - Fixes for using %constant and objects (non-primitive types)

2015-01-15: wsfulton
[C Go] Merge patch 308 and fix 307 - C++11 strongly typed enum support
in directors

2015-01-15: wsfulton
[Python] Second fix for 294 296 - Regression introduced in SWIG-3.0.3 when
wrapping functions with default arguments, this time when using kwargs.

3.0.4

===========================

2015-01-12: olly
[PHP] Fix segfault in director upcall check when using PHP built with
ZTS enabled. Fixes 155, reported by Pierre Labastie.

2015-01-12: vadz
[Python] Fix 294 296 - Regression introduced in SWIG-3.0.3 when
wrapping functions with default arguments. Invalid or missing default
arguments were sometimes being generated into the python layer.

2015-01-08: olly
Allow C++11 "explicit constexpr". Fixes github issue 284 reported
by Pawel Tomulik. Also handle "constexpr explicit" and "constexpr
static".

2015-01-08: olly
When reporting an error for a construct which hasn't been
terminated when the end of the file is reached, report it at the
start line rather than "EOF" as then tools like editors and IDEs
will take you to a generally more useful place for fixing the
problem.

2015-01-08: olly
Improve error messages for a few cases which previously gave the
one of the cryptic catch-all errors "Syntax error in input".

2015-01-08: olly
Provide -cppext as a general command line option for setting the
extension used for generated C++ files (previously it was specific
to the PHP backend). Deprecate the equivalent -suffix option
provided by the Ocaml backend, but continue to support that for
now.

3.0.3

===========================

2014-12-27: wsfulton
Fix 280 - abort using all default template parameters within other template
parameters.

2014-12-27: talby
[Perl] Issue 282 perl5 archlib vs archlibexp
[Perl] tidy "warning: duplicate 'extern' declaration specifier" when building generated code
under clang

2014-12-18: wsfulton
Add support for %constant and structs/classes - issue 272

2014-12-09: wsfulton
Fix 245 - regression (since swig-3.0.0) in templated constructors.
Templated constructors could not be instantiated - they were incorrectly ignored with a warning 504:
"Function: xyz must have a return type. Ignored."

2014-12-07: wsfulton
Add support for C++11 strongly typed enumerations.

2014-11-21: wsfulton
[Java C] Fix multiply defined error when using %rename of enum items when using the "simple enum"
wrappers.

2014-10-28: vadz
[Python] Patch 201 The generated .py file no longer uses *args for all Python parameters.
Instead, the parameters are named using the C++ parameter names.

"compactdefaultargs" feature can be enabled to restore the old behaviour.

*** POTENTIAL INCOMPATIBILITY ***

2014-10-24: timotheecour
[D] Patch 204 Use core.atomic.atomicOp to mutate shared variables

2014-10-21: wsfulton
Fix issue 242 - Use of the "kwargs" feature no longer automatically turns on the
"compactdefaultargs" feature if the target language does not support kwargs.
This change affects all languages except Python and Ruby.

*** POTENTIAL INCOMPATIBILITY ***

2014-10-10: diorcety
[Python] Patch 232 Fix property access using directors

2014-10-06: wsfulton
[Python] Fixes when using -builtin and std::vector/std::list wrappers to allow deletion
of single elements, such as 'del vec[0]'.

2014-09-30: oliverb
[Javascript] Merge patch 216 by Richie765 - Added support for many versions of v8 javascript.

2014-09-30: oliverb
[Javascript] Merge patch 195 by zittix - Fixed JSClassRef declaration not using the static one.

2014-09-30: ianlancetaylor
[Go] In configure script, require Go 1.1 or later.

2014-09-30: wsfulton
[Python] Patch 207 - Fix No module error with -relativeimport when using single
header file import.

2014-09-27: wsfulton
Patch 208 - Initialise newly created array when using array_functions in the
carrays.i library (C++ usage).

2014-09-27: wsfulton
[Ruby] Patch 187 - Fix crash on shutdown of the Ruby interpreter if more than one
module was loaded at a time when data is being shared between modules.

2014-09-27: wsfulton
[Java] Patch 168 - Fix leak in Java director string handling after the Java
upcall when called from a native thread.

2014-09-25: ianlancetaylor
[Go] Adjust generated code to work with upcoming Go 1.4
release.

2014-09-23: wsfulton
[Python] Add patch from Thomas Maslach to fix crash in wrappers when using -threads in
the STL iterators (SwigPyIterator destructor).

2014-09-17: wsfulton
[C] Merge patch 229 from contre - Add bool array types to arrays_csharp.i

2014-09-12: olly
[PHP] Add support for specifying any PHP interfaces a wrapped class
implements, e.g.: %typemap("phpinterfaces") MyIterator "Iterator"

2014-09-11: olly
[PHP] Fix throwing a PHP exception through C++ from a subclassed
director method - PHP NULL gets returned by the subclassed method
in this case, so the directorout typemap needs to allow that (at
least if an exception is active).

2014-09-09: ianlancetaylor
[Go] Add goargout typemap.

2014-09-09: olly
[PHP] Fix segmentation faults with directors in PHP >= 5.4, and
reenable runme tests for director_basic testcase. Fix from
pavel-charvat in issue164.

2014-09-05: ianlancetaylor
[Go] Add imtype, goin, goout, godirectorin, and
godirectorout typemaps, to support writing Go code to
convert between types.

2014-09-02: olly
[Python] Fix regression in indentation of python code produced with
-modern, introduced by changes in 188. Reported by fabiencastan
in 218.

2014-09-01: olly
Issue an error for unknown SWIG preprocessor directives, rather
than quietly ignoring them. Reported by jrhelsey in issue217.

*** POTENTIAL INCOMPATIBILITY ***

2014-08-15: talby
[Perl] Include guard fix for nested modules from Anthony Heading (SF Patch 350).

2014-08-04: wsfulton
[C] Merge patch 200 from gpetrou - Changed CSharp license header to include auto-generated
tag so that StyleCop ignores the files.

2014-08-04: wsfulton
[Java] Merge patch 198 from Yuval Kashtan - Support for java.nio.ByteBuffer mapping to
unsigned char * in various.i in NIOBUFFER typemaps.

2014-07-14: ianlancetaylor
[Go] Change struct definition to use void *, not uint8, so
that the type is recorded as possibly containing
pointers. This ensures that the 1.3 garbage collector
does not collect pointers passed to C++ code.

2014-07-01: wsfulton
Fix SF Bug 1375 - Expansion of the $parentclassname special variable incorrectly contains
brackets in the expanded name.

3.0.2

==========================

2014-06-02: v-for-vandal
[Lua] Pull request 176:
If class has no __eq implemented, then default __eq is generated.
Default __eq compares actual pointers stored inside Lua userdata.

2014-06-02: vkalinin
Fix 183 - %extend and unnamed nested structs

2014-05-28: kwwette
Fix install failure when using an 'out of source' build using the shipped
tarball - regression introduced in swig-3.0.1.

2014-05-24: kwwette
[Octave] Remove deprecated -global/-noglobal command-line arguments

*** POTENTIAL INCOMPATIBILITY ***

Page 3 of 13

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.