Found via `codespell -q 3 -L ans,anumber,ba,bae,chello,clos,cmo,coo,dout,fo,funktion,goin,inout,methid,nd,nin,nnumber,object,objekt,od,ois,packag,parm,parms,pres,statics,strack,struc,tempdate,te,thru,uint,upto,writen`
This appears to have been accidentally added in
d8cc75946b as part of the changes to
support C++11 rvalue references, presumably to match the existing
correct rule for unary &.
There is a non-standard GCC extension for taking the address of a label
using unary &&:
https://gcc.gnu.org/onlinedocs/gcc/Labels-as-Values.html
However this extension only works in an expression in a function body,
and SWIG doesn't parse the contents of function bodies so this grammar
rule isn't even providing any useful support for this extension.
Use `#pragma GCC poison` (supported since GCC 3, maybe earlier) when
compiling with GCC to help prevent direct uses being introduced for
functions which DOH provides a wrapper for.
Exit() is a wrapper for exit() by default, but SetExitHandler() allows
specifying a function to call instead.
This means that failures within DOH (e.g. Malloc() failing due to lack
of memory) will now perform cleanup such as removing output files.
This commit also cleans up exit statuses so SWIG should now reliably
exit with status 0 if the run was successful and status 1 if there was
an error (or a warning and -Werror was in effect).
Previously in some situations SWIG would try to exit with the status set
to the number of errors encountered, but that's problematic - for
example if there were 256 errors this would result in exit status 0 on
most platforms. Also some error statuses have special meanings e.g.
those defined by <sysexits.h>.
Also SWIG/Javascript tried to exit with status -1 in a few places (which
typically results in exit status 255).
Previously code in the SWIG tool didn't handle allocation failures
well. Most places didn't check for NULL return from
malloc()/realloc()/calloc() at all, typically resulting in undefined
behaviour, and some places used assert() to check for a NULL return
(which is a misuse of assert() and such checks disappear if built with
NDEBUG defined leaving us back with undefined behaviour).
All C allocations are now done via wrapper functions (Malloc(),
Realloc() and Calloc()) which emit and error and exit with non-zero
status on failure, so a non-NULL return can be relied upon.
Fixes#1901.
Specifying a value on the typemap method now gives an error, e.g.:
%typemap(argout=123) char * ""
The old way of specifying a language name in the typemap attributes
is no longer supported (it has been deprecated for 16 years).
Closes#891
If it's not a recognised directive the scanner now emits MODULO and then
rescans what follows, and if the parser then gives a syntax error we
report it as an unknown directive. This means that `a%b` is now allowed
in an expression, and that things like `%std::vector<std::string>` now
give an error rather than being quietly ignored.
Fixes#300Fixes#368
We were passing flags of DOH_REPLACE_ANY|DOH_REPLACE_FIRST in three
places, which doesn't make sense as those are mutually exclusive
concepts. In the current implementation DOH_REPLACE_FIRST wins in
this situation, so replace with that and clarify the docs.
YYEOF works as a token for "end of file" on my dev box but fails in
CI. I assume it must be a Bison version difference.
Based on the Bison manual, I'm trying this fix (which also works on my
dev box).
Adding full support for these in expressions seems hard to do without
introducing conflicts into the parser grammar, but in fact all reported
cases have had parentheses around the comparison and we can support that
with a few restrictions on the left side of `<`.
Fixes#80 and #635. Also https://sourceforge.net/p/swig/bugs/1139/
Document extern template functions support.
Extern templates result in new warning to differentiate
from template explicit instantiation definition warning.
* Issue-1632:
Minor workaround in doxygen_basic_translate_style3 test
Add new test doxygen_basic_translate_style3.i
Fix for newline handling in doxygen "///" style comments
Fix parsing of C++11 identifiers with special meaning (final and override) when
they are used as part of the scope name of an identifier, such as a namespace name.
Closes#1679
Previously, the newlines in "///" doxygen comments were being stripped
out, resulting in incorrect translation of the comments for Python and
Java. During scanning, "///" comments are processed line by line,
whereas "/*" style get processed as a block with newlines intact.
The fix checks for the "///" style in scanner.c and manually adds a
newline at the end of each comment line. Some extra logic is also
added to properly handle empty "///" comments and ensure that a
newline gets added for those, which would otherwise be skipped.
Parsing "/**/" with -doxygen would result in a crash due to
calculation of comment start/end that does not work for an empty
comment. Fixed by catching this case prior to processing. Added
simple regression test to doxygen_basic_translate.
Fix regression in 4.0.0 where a template function containing a parameter
with the same name as the function name led to the parameter name used in the
target language being incorrectly modified.
Closes#1602