C Constructs That Still Don't Work in C++ – and a Few That Changed
The article discusses the ongoing differences between C and C++ regarding certain constructs, highlighting changes introduced in C++20 and C23. It emphasizes that C++ is not a superset of C and that compatibility discussions now require specifying the exact language version. The author provides a compatibility matrix to illustrate these differences and offers practical advice for developers transitioning between the two languages.
- ▪C++20 introduced designated initializers and repaired some object-lifetime issues related to malloc.
- ▪C23 changed the interpretation of empty parameter lists, making void f() behave differently than in C.
- ▪The article stresses the importance of specifying language versions when discussing C/C++ compatibility.
Opening excerpt (first ~120 words) tap to expand
Blog | May 20, 2026 C Constructs That Still Don’t Work in C++ — and a Few That Changed A 2026 sequel to C Constructs That Don't Work in C++: what still breaks, what C++20 changed, and what C23 changed. GitHubJLospinoso/c-constructs-still-dont-work-cpp In 2019 I wrote a short survey of C constructs that do not work in C++. The point was not that C is sloppy or that C++ is superior. The point was that C++ is not a superset of C, and that C programmers crossing the border should know where the checkpoints are. That advice still holds. But the border moved. C++20 picked up a version of designated initializers. C++20 also repaired some low-level object-lifetime cases around malloc that used to be easy to describe incorrectly.
…
Excerpt limited to ~120 words for fair-use compliance. The full article is at lospino.so.