C language seems to be using a cpp compiler?
justlucdewit opened this issue · comments
When I try to compile my C code using the CodeX C compiler, i get a lot of errors complaining about casting a void* to something else, which is fine in C however forbidden in CPP (source: https://stackoverflow.com/a/22744183/11804669)
Which is really weird because that would mean the C language for CodeX is actually compiled as if it was C++
So as a test I tried copy pasting a C++ Hello World script into it (which should not AT ALL) compile if it was really C
and that worked
Also it seems that in the code, there is a file for c_or_cpp instead of seperate files, which further implies it is just blindly compiling C with a cpp compiler https://github.com/Jaagrav/CodeX-API/tree/master/executeCode
Infact, here is the line that is the problem: https://github.com/Jaagrav/CodeX-API/blob/master/executeCode/c_or_cpp.js#L8
It is using g++ even when the language is C, while I would expect it to use gcc instead
I created a pull request for ya, hopefully this works, but please review carefully #10
The API is back live, check out this release. I have made the changes based on your PR, thanks for your contribution.