Olly Betts
31af3ce9bf
Avoid -Wempty-body warnings from SWIG_contract_assert
2022-02-11 18:39:08 +13:00
Olly Betts
b624d17f3f
Merge branch 'swig-fortran/extern-c-int'
...
Fixes #2199
2022-02-11 08:28:27 +13:00
Seth R Johnson
c21b4a5529
Fix cpp11_thread_local test
2022-02-11 08:25:03 +13:00
Seth R Johnson
2ecc5bc214
Don't warn about legal extern "C++" {} block
2022-02-11 08:25:03 +13:00
Seth R Johnson
4bdf454e97
Add extern C thread_local test cases
2022-02-11 08:25:03 +13:00
Olly Betts
89a0a3c5f7
Merge pull request #2197 from swig-fortran/rename-warn
...
Print rename warnings except anonymous template methods
2022-02-10 16:15:10 +13:00
Dimitris Apostolou
40c3bf30b2
Fix typos
2022-02-10 16:12:24 +13:00
Olly Betts
bb15c4eccf
[Tcl] Fix Tcl generic input typemap for std::vector
...
Fixes https://sourceforge.net/p/swig/bugs/1207/
Fixes https://sourceforge.net/p/swig/bugs/1213/
2022-02-10 09:55:58 +13:00
Olly Betts
1d088d7124
Fix comments about version Tcl bug fixed in
2022-02-08 16:39:42 +13:00
William S Fulton
d59cbf1c39
Fragments: additional testing and documentation enhancements
...
Add test for original syntax when using a single fragment key containing
the list of dependent fragments. I couldn't find a test for this.
Spaces in the fragment list don't seem to work - document it.
2022-02-07 21:45:33 +00:00
William S Fulton
013be550ed
Merge branch 'fragment-typemap' into upstream-master
...
* fragment-typemap:
Add documentation
Enable multiple 'fragment' keywords to be attached to typemaps
2022-02-07 20:35:08 +00:00
Seth R Johnson
befc9bc1f0
Mark 'externc' storage for variables
2022-02-06 20:49:01 -05:00
Olly Betts
467c530e65
Remove support for the "command" encoder
...
The "command" encoder was mostly intended for use in `%rename` - most
uses can be achieved using the "regex" encoder, so we recommend using
that instead.
The "command" encoder suffers from a number of issues - as the
documentation for it admitted, "[it] is extremely slow compared to all
the other [encoders] as it involves spawning a separate process and
using it for many declarations is not recommended" and that it "should
generally be avoided because of performance considerations".
But it's also not portable. The design assumes that `/bin/sh` supports
`<<<` but that's a bash-specific feature so it doesn't work on platforms
where `/bin/sh` is not bash - it fails on Debian, Ubuntu and probably
some other Linux distros, plus most non-Linux platforms. Microsoft
Windows doesn't even have a /bin/sh as standard.
Finally, no escaping of the passed string is done, so it has potential
security issues (though at least with %rename the input is limited to
valid C/C++ symbol names).
Fixes #1806
2022-02-07 09:47:01 +13:00
Seth R Johnson
018254cca3
Reformat name warnings to reduce changes
2022-02-06 13:51:37 -05:00
Seth R Johnson
307c9814a0
Prevent "__dummy_0__" template methods from matching name warnings
2022-02-06 13:51:37 -05:00
Seth R Johnson
de78b80de9
Renames performed by %namewarn with rename= are printed in warning message
...
This is necessary for regex-like renames (where you can't use the #define trick
as is done in many of the %keywordwarn directives). It's now unnecessary to print
the "renaming to '`x`'" code explicitly by the kw.swg files.
2022-02-06 13:51:37 -05:00
Olly Betts
d47970e2fd
Fix problem with recent commit
...
I failed to fully remove the conditional from one example in
1a03840172 .
2022-02-06 16:50:30 +13:00
Seth R Johnson
325056453a
Enable multiple 'fragment' keywords to be attached to typemaps
...
This is consistent with the use of `%fragment`. Previously only the last
`fragment=` keyword would be added.
2022-02-05 19:03:43 -05:00
Olly Betts
b06ab566cb
-DFOO on the SWIG command line now sets FOO to 1
...
This is consistent with C/C++ compiler preprocessors. Previously
SWIG set FOO to an empty value.
Fixes #2193
2022-02-06 10:18:49 +13:00
Olly Betts
f85626207c
Merge pull request #2194 from swig-fortran/mark-noassign
...
Auto-detect non-assignable classes
2022-02-06 09:44:29 +13:00
Olly Betts
1a03840172
[octave] Simply checks on exist()
...
As suggested by kwwette in #1672 , just check exist() is non-zero in
cases where the non-zero value returned varies depending on Octave
version.
2022-02-06 09:03:16 +13:00
Seth R Johnson
5b7edebdba
Placate scilab character limit
2022-02-04 14:54:11 -05:00
Seth R Johnson
5a2656ab80
Don't mark as "noassign" when a variable is immutable
...
I had assumed member variables could only be noassign by being "const",
but I had forgotten about the `%immutable` keyword being applied via
SWIG.
2022-02-04 14:03:01 -05:00
Seth R Johnson
03dd2ec39d
Auto-detect non-assignable classes
...
Classes with references or const data are now marked as 'noassign'.
This renders many explicit `private: operator=` declarations redundant.
2022-02-04 09:51:18 -05:00
Olly Betts
a60655a86b
Merge branch 'octave-4-4-bugfix' of https://github.com/friedrichatgc/swig
...
Fixes #1672
2022-02-04 16:36:05 +13:00
Olly Betts
07f3637f06
[PHP] Remove useless shadowed variable in example
2022-02-03 23:04:58 +13:00
Olly Betts
ebbf2e6077
Allow method calls in expressions
...
This allows default parameter values containing method calls to be
parsed and handled - e.g. `x->foo(3,4)` and `y.z()`.
Fixes #660 and https://sourceforge.net/p/swig/bugs/1081/
2022-02-03 17:20:30 +13:00
Olly Betts
20588a4dc7
Uncomment line in testcase which now works
...
03ef3ecb6e86aa78a64119f30e683ee474ddb56 added support for ID PERIOD ID
in an expression.
2022-02-03 17:20:30 +13:00
Olly Betts
2e98189564
[Ruby] Fix remove of prefix from method name
...
The prefix is now only removed at the start.
Fixes https://sourceforge.net/p/swig/bugs/1136/
2022-02-02 15:53:23 +13:00
Olly Betts
27a3d16ac6
Allow object reference in C++ trailing return type
...
Fixes #231
2022-02-02 11:31:45 +13:00
Olly Betts
9d06d4ac45
[Tcl] Add changed file missed recent commit
...
This should have been in 6f4adde4b4
2022-02-01 16:00:12 +13:00
Olly Betts
3e019977c5
Merge pull request #1398 from swig-fortran/missing-includes
...
Add missing includes to library and test cases
2022-02-01 14:05:17 +13:00
Olly Betts
6f4adde4b4
[Tcl] Fix std_vector typecheck typemaps
...
In some cases the typecheck typemap would try to access the first
element of an empty Tcl list.
Fixes https://sourceforge.net/p/swig/bugs/1309/
2022-02-01 13:09:00 +13:00
Olly Betts
7813793511
[R] Fix CopyToR() generated for struct in namespace
...
Fixes https://sourceforge.net/p/swig/bugs/1147/
2022-01-31 12:05:09 +13:00
Olly Betts
25f996a5c8
[python] Replace uses of assert in testsuite
...
We're not supposed to assert for this, as mentioned in #1488 .
2022-01-30 13:38:56 +13:00
Olly Betts
d9ced1e56d
Coding style tweaks
2022-01-30 10:55:00 +13:00
Frank Schlimbach
4ce2964ab8
adding support for structs, docu
2022-01-30 10:55:00 +13:00
Frank Schlimbach
63452e9fc1
better handling of using directives
2022-01-30 10:55:00 +13:00
Olly Betts
d2d2bfa05f
Add CHANGES entry and regression test for #676
2022-01-29 22:35:29 +13:00
Olly Betts
7ec2f89fe2
Remove redundant NULL checks before free()/delete ( #2184 )
...
Remove redundant NULL checks before free()/delete
The ISO C and C++ standards guarantee that it's safe to call these
on a NULL pointer, so it's not necessary for the calling code to
also check.
Fixes https://sourceforge.net/p/swig/feature-requests/70/
2022-01-29 22:03:48 +13:00
Olly Betts
f0c0816cde
Update out-of-date docs re _runme3.py
2022-01-27 16:10:10 +13:00
Olly Betts
282e4ed4ab
Issue error for missing ; after %constant
...
Previously there was no warning or error, no files were produced,
but exit status was 0.
Fixes #346
2022-01-27 15:35:24 +13:00
Olly Betts
07f5b37c30
Fix invalid code in testcase typemap_qualifier_strip.i
...
This testcase was using a pointer to a variable which had gone out
of scope, which is undefined behaviour. The test was only passing
because the tests are compiled without optimisation by default and
the memory where this value lived happened to remain intact in that
case with current versions of compilers we test with. Running the
testsuite with CXXFLAGS=-O2 causes this test to fail.
Fix by extending the lifetime of the variable to the whole wrapper
function.
Fixes #1925
2022-01-26 15:39:38 +13:00
Olly Betts
f104c4411f
Rename variable in director_thread test
...
This avoids a clash with thread_terminate defined in an AIX include
file.
Fixes #1921
2022-01-26 15:23:46 +13:00
Olly Betts
0a7192ce8b
[doxygen] Fix crash on unclosed HTML tag
...
Fixes #1935
2022-01-26 15:12:21 +13:00
Olly Betts
ccd313ac64
Move new testcase which needs C++11
...
I don't see how to easily write this without constexpr.
2022-01-26 13:25:36 +13:00
Olly Betts
e03ef3ecb6
Support foo.bar in constant expressions
2022-01-26 12:43:45 +13:00
Olly Betts
6db66bc350
Drop is_python_modern() in testcase
...
Python is always "modern" since e4fceee12f .
2022-01-26 12:30:44 +13:00
Olly Betts
7ab24e7e86
Support most cases of sizeof applied to an expression
...
Previously there was only support for `sizeof(<type>)` and expressions
which syntactically look like a type (such as `sizeof(foo)`).
Fixes #2091 .
2022-01-25 23:47:01 +13:00
Olly Betts
6f952806e4
Enable testcase for %
...
This was commented out with a FIXME, but actually works. Probably
fixed back in 2009 by 02eb6a81d1 !
2022-01-25 14:09:49 +13:00