3 ms·
Unless the undefined behaviour is hidden in printf or scanf, this code exhibits none. Variadic functions are reasonably well defined and no type aliasing takes
by AstralStorm 8y ago
Unless the undefined behaviour is hidden in printf or scanf, this code exhibits none.
Variadic functions are reasonably well defined and no type aliasing takes place.
(And you're missing a few error checks.)
- saagarjha 8y agoCan the people downvoting this comment provide a reason why? It seems perfectly reasonable to me.
- deleted 8y ago[deleted]
- jcelerier 8y agoInteger overflow is undefined behaviour so an input for instance of 2147483647 and 1 makes the program invalid.
- saagarjha 8y agoSure, but the program is well-defined on inputs that do not cause it to overflow. It does not perform undefined behavior in those cases, so it's correct given those preconditions.