Some of the C code do not compile with C++ compiler if compiled as C++ files, due to the stricter type safety of C++. Is there any tool which takes the C code and generates a valid C++ code out of it. In other words, it adds to the C code what is required to make that code compile with a C++ compiler.
Note that I know that C and C++ code can be linked, but here I’m specifically talking about taking a C code and compiling it with a C++ compiler treating them as C++ code files.
Try compiling with additional flags to make it less strict and/or a different compiler.
Edit #1: I can’t add comments. I’m just throwing around ideas, I haven’t first-hand executed these. After a bit of digging around, you might be SOL depending on if the C code is written in part of the set that isn’t a subset of C++.
If it’s just non-ansi C standard issues, you might be able to finagle it. If you’re using gcc, maybe try using Microsoft Visual C++ or OpenWatcom.
As for the flags, I thought you could do leniency, but I could be wrong. The flags will depend on the compiler, I think I’ve used -std=isoC99, -compat, -feat=features.