Conversation

twitter.com/kardonice/stat You could argue that while(1); being transformed into nothingness is well-defined. But itโ€™s shocking for a lot of programmers. And I would be curious if any compiler actually does that in practice.
Quote Tweet
Replying to @KardOnIce @jckarter and 2 others
"[ Note: This is intended to allow compiler transfor- mations, such as removal of empty loops, even when termination cannot be proven. โ€” end note ]"
1
The first one requires VLAs in C99, which are not supported in C++ (and never should have been supported in C, IMO), and the second requires an implicit void cast, which C++ requires the use of `reinterpret_cast` for, making the implicit cast explicit.
2
Designed initializers, restrict and a bunch of other C99 / C11 features were also not adopted by C++. My example demonstrates that C89 is not a subset of any C++ standard though. There are other examples of that but it's what first comes to mind when I think about differences.
2
1