Currently SWIG tests run C compiler without  '-ansi -pedantic', so no checks for C89-compatibility. May be it should be added ?

On 23 May 2014 04:03, William S Fulton <> wrote:
On 23/05/14 00:45, Vadim Zeitlin wrote:
> On Thu, 22 May 2014 14:39:59 -0700 Eric Wing <> wrote:
> EW> > Olly, William, is it true that SWIG must support pedantic C89 ? Because
> EW> > there is already a lot of code in luarun.swg that doesn't follow C89 rules,
> EW> > especially the 'variable at the beginning of the block' rule. Most of that
> EW> > code is - alas - mine.
> EW>
> EW> C89 is needed to support Visual Studio because they still drag their
> EW> feet after 25 years. This is a constant sore point for me.
>   In practice, this can be almost always easily worked around by compiling C
> code as C++ (using /TP compiler option or just renaming the file to have .cpp
> extension). In SWIG case I really wish the entire code base could move to
> C++ anyhow, so I'd serious consider doing this instead of sticking to C89.
The problem is the generated wrappers, not the SWIG source. SWIG's
generated wrappers try and use a lowest common denominator code for
maximum portability. I'm afraid that compiling C code as C++ doesn't
always work. It has been a recent source of headaches for the Octave and
Javascript generators which have C++ apis instead of C and so the output
is compiled as C++.


"Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
Instantly run your Selenium tests across 300+ browser/OS combos.
Get unparalleled scalability from the best Selenium testing platform available
Simple to use. Nothing to install. Get started now for free."
Swig-devel mailing list

Sincerely yours,
Artem Serebriyskiy