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.
sed -i "s/\(const \)\?String_or_char \*/const_String_or_char_ptr /g" CParse/* Include/* Modules/* Preprocessor/* Swig/*
This is a preparation for moving to new DOH, since for strong typed objects we need the const_String_or_char_ptr class to implicit convert to and from String * or const char *.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11080 626c5289-ae23-0410-ae9c-e8d60b6d4f22
- EOF not displaying in correct format
- Some error messages containing a path were using a double backslash instead of a single backslash
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@6161 626c5289-ae23-0410-ae9c-e8d60b6d4f22
of the strings start like "Error. XXX", others like "XXX".
The format is now defined in 'error.c:Swig_error_msg_format()'.
- Normalize the multiline error/warning messages to correctly
use -Fformat definition.
- Centralize the error/warning format definitions in
'error.c:Swig_error_msg_format()'.
- Fix a minor error in cpp.c, that after finding an error, still
was emitting a redefined macro, producing duplicated error/warning
messages in parser.y.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5635 626c5289-ae23-0410-ae9c-e8d60b6d4f22