Conversation

Replying to and
You're misinformed about what was changed and the impact of the change. I suggest referring to the C11 standard. It's a controversial change but isn't tied to what the standard says is undefined behavior. There's a big difference between permitted implementation choices and UB.
1
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
C89 isn't far from being a subset of C++, but it isn't one. Another trivial example is that C++ reserves more keywords and will break C code using those as names (like class) but it's less interesting than differences like 'c' really being an int constant in C and char in C++.
1