3 ms·
There are many more, though what comes immediately to mind are variadic macros and long long. (Actually, here's a good list: https://stackoverflow.com/questions
by wahern 7y ago
There are many more, though what comes immediately to mind are variadic macros and long long. (Actually, here's a good list: https://stackoverflow.com/questions/47524553/are-all-of-the-features-of-c99-also-in-c https://stackoverflow.com/questions/47524553/are-all-of-the-...)
Are there any widely used C++ compilers that don't also have a C personality? I've only ever worried about C++ compatibility in my headers. IME C and C++ toolchains make it relatively trivial to build and link C and C++ units together. However, I don't have much experience in the commercial embedded space (as opposed to x86 appliance "embedded"), which I've assumed were mostly C shops.
- flohofwoe 7y agoFor single-file libraries (declaration and implementation in one header) it's sometimes more convenient to include the header implementation into a C++ file (and not compile the implementation in a separate C file). Also, compiling C code in C++ mode might trigger a couple more warnings which are actually bugs. But these are the only reason I can think of compiling C code as C++.
- kazinator 7y ago> Are there any widely used C++ compilers that don't also have a C personality? All of them. If you mean "aren't accompanied by a C compiler front-end also", that's something else. If you want that C++ compiler's opinion about your code, then you have to pass it to the C++ compiler, not to its C cousin that has tagged along.