Add a way to interpret C code

Hello !

I’m starting testing cling for my future projects and after compiling from sources without problems I started doing some tests with cling, one of then was to feed sqlite3.c amalgamated via “.L sqlite3.c” and because not all valid C programs are valid C++ programs like with sqlite3.c cling/clang++ rejected it point several errors mainly due to assign pointers from void to other types.

Of course ideally that kind of errors would be fixed adding casts, but as they work as expected without problems with a C compiler like “clang” not “clang++”, I was thinking that would be a good idea to have a way to indicate if we want to parse source files as “C++” or “C” to be allowed to use third party “C” sources.

I even tried to wrap sqlite3 with a c++ source shell but it still parse the internal C code with C++, maybe even this is a clang/clang++ bug:

extern “C” {
#include “sqlite3.c”

Thanks in advance for your time, attention and great work !

You can start cling in C mode: cling -x c
Or you could suppress the warnings (the same way as in a compiler invocation) -W…