We are creating Smalltalk/X binding to Xerces C++ validating parser.
After we solved all the gcc vs g++ compilation, extern "C" wrapping etc,
we run into following problem:
in SAX content handler & input stream class we need to send a message to
smalltalk and manipulate with return values and create new smalltalk objects.
In C++ header file, we includes stc.h wrapped in extern "C" block to avoid
C++ name mangling. However, several functions uses K&C style (i.e. there
are not formal parameter declarations so C compilers allows one to pass
any number of arguments implictly typed int). This is not valid in C++.
Affected functions are for instance __ADD_REFCELL, __REMOVE_REFCELL,
__MKSYMBOL, __MKINT.
Is there any reason for using K&R style for those functions? If not, I suggest
to add formal argument declaration in next release, this will ease using C++ libraries.
We workarounded this issue by wrapping all those function into our own ones,
declaring all variables properly and compiling these function by gcc.
For details, look at: