3 ms·
honestly, no one cares about splitting that hair. Most valid C programs will compile in C++ and believe it or not, binary logic is not the only logic humans ar
by PH95VuimJjqBqy 3y ago
honestly, no one cares about splitting that hair. Most valid C programs will compile in C++ and believe it or not, binary logic is not the only logic humans are capable of.
- zabzonk 3y agoactually, i reckon that most, if any, c programs will not compile with c++, without at least some (possibly not difficult) modifications
- latency-guy2 3y agoMy only qualms is the number of genuine C only compilers in use, vs number of embedded system companies/projects/codebases in the world. The subset of C features that are incompatible with C++ is quite small, and most of the features are a little out of the way IMO. Of the regular suspects (GCC, MSVC, Clang), your C codebase is probably entirely compatible with C++ as each of these has varying levels of compliance with the C and C++ standard.
- PH95VuimJjqBqy 3y ago> Of the regular suspects (GCC, MSVC, Clang), your C codebase is probably entirely compatible with C++ as each of these has varying levels of compliance with the C and C++ standard. yep, leave it up to the technical crowd to try and split hairs too fine.
- tsimionescu 3y agoAlmost every C program does `int *c = malloc(sizeof(int) *10)` or similar, which has always been invalid C++.
- fluoridation 3y agoI believe most compilers have switches to allow this. The real issue you might run into that can't be worked around easily is if the C source uses a C++ keyword as an identifier.
- kragen 3y ago#define new new_