3 ms·
Not surprising and not a "wart". C and C++ have diverged since the mid-90s and are two very different languages now. E.g. trying to build C code with a C++ comp
by flohofwoe 11mo ago
Not surprising and not a "wart". C and C++ have diverged since the mid-90s and are two very different languages now. E.g. trying to build C code with a C++ compiler really doesn't make much sense anymore (since about 20 years).
- loeg 11mo agoPeople still routinely want to incorporate C libraries in C++ code, using C headers. It mostly works.
- Arch-TK 11mo agoSure, but it works mostly by intentional hobbling of headers. Meanwhile in other languages you just write/generate bindings and they survive it.
- loeg 11mo agoThe most important C feature that C++ lacked for a long time was C99 designated initializers, but C++ finally supports them in C++20[0]. Other than that... I'm not sure what hobbling you have in mind. Many C23 features come directly from earlier C++ standards (auto, attribute syntax, nullptr, binary literals, true/false keywords). VLAs? Though these are optional in newer C standards, too. [0]: https://en.cppreference.com/w/cpp/language/aggregate_initialization.html#Designated_initializers https://en.cppreference.com/w/cpp/language/aggregate_initial...
- uecker 11mo agoFor me it is complex and variably modified types (mandatory in C23).
- flohofwoe 11mo ago> C99 designated initializers, but C++ finally supports them in C++20 Unfortunately C++20 designated init has been butchered so much compared to the C99 that it is pretty much useless in practice except for the most trivial structs (for instance designators must appear in order of declaration, array item init is completely missing, designator chaining doesn't work ... and those are only the most important things).