5 ms·
Reading an indeterminate value is its own undefined behaviour. See the second bottom paragraph on page 492: https://www.open-std.org/jtc1/sc22/wg14/www/docs/n12
by orra 2y ago
Reading an indeterminate value is its own undefined behaviour. See the second bottom paragraph on page 492: https://www.open-std.org/jtc1/sc22/wg14/www/docs/n1256.pdf https://www.open-std.org/jtc1/sc22/wg14/www/docs/n1256.pdf
- lmm 2y agoThat's a change in C11. It was not undefined behaviour in C99 (which was the live standard at the time).
- orra 2y agoI linked N1256, which is essentially C99 plus the errata (Tchnical Corrigendum 1, 2, & 3).
- lmm 2y agoThe standard did not state that at the time. Consider Defect Report #451 (as discussed in 2013 and 2014), and observe that the committee did not simply respond that the example therein is undefined behaviour.