3 ms·
Is this really undefined behavior? The C spec says (6.7.8.10) "If an object that has automatic storage duration is not initialized explicitly, its value is ind
by panic 11y ago
Is this really undefined behavior? The C spec says (6.7.8.10) "If an object that has automatic storage duration is not initialized explicitly, its value is indeterminate." The fact that the indeterminate value could be a signaling NaN is a feature of floating point numbers, not C.
- aciuix 11y agoThe example shown in the article is in fact undefined behavior: 6.3.2.1,p2 If the lvalue designates an object of automatic storage duration that could have been declared with the register storage class (never had its address taken), and that object is uninitialized (not declared with an initializer and no assignment to it has been performed prior to use), the behavior is undefined.
- _yosefk 11y agoThe funny thing is, returning it just to discard it constitutes "use", apparently.
- deleted 11y ago[deleted]