2 ms·
I consider the use of undefined behaviour in trivially detectible cases like this a great mistake. Sure, undefined behaviour is useful for many Compiler optimiz
by n_plus_1_acc 3y ago
I consider the use of undefined behaviour in trivially detectible cases like this a great mistake. Sure, undefined behaviour is useful for many Compiler optimizations, but requiring qsort implementations to not do out-of-bounds reads does not hurt.
- mjevans 3y agoIMO Optimizations like that should be at least a __warning__ and ideally lead to refactored and more correct code as a result. Also IMO, the default should always be unsigned (modulus) integers, not signed. That would promote more correct consideration of integer types and operations. Yes, the ship has sailed on that, but it would also be nice if code linters added 'signed ' where not specified to remind everyone of the present default.