Jaagrav / CodeX-API

The new version of CodeX API with it's backend, a lot of you wanted me to make the backend opensource, now it's ready to receive contributions from you. Thanks for being patient, more languages coming soon, happy hacking!

Home Page:https://codex.jaagrav.in/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

C language seems to be using a cpp compiler?

justlucdewit opened this issue · comments

commented

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

commented

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

commented

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

commented

I created a pull request for ya, hopefully this works, but please review carefully #10

commented

The API is back live, check out this release. I have made the changes based on your PR, thanks for your contribution.

https://github.com/Jaagrav/CodeX-API/releases/tag/v1-alpha