|
|
|
|
|
by Kranar
1176 days ago
|
|
It's a common misconception that a conforming program may not engender undefined behavior. In fact this very article touches on how realloc has introduced new (and backwards incompatible) undefined behavior precisely to accommodate the POSIX standard (so that POSIX compliant implementations of C can redefine the otherwise undefined behavior however they please). |
|
While I was making sure I wasn't missing something obvious, I took a look through the rest of the WG14 proposals to see if I was somehow off in my understanding regarding translators being allowed to barf over UB anywhere in the program. There was a proposal clarifying the situation to the possible-execution understanding from upthread submitted by Victor Yodaiken (n2278 [2]), but unfortunately it was also never adopted.
[1] https://www.open-std.org/jtc1/sc22/wg14/www/docs/n853.htm
[2] https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2278.pdf