| ▲ | debugnik 2 days ago | |||||||
"Enabling wrapping behaviour" for signed integers disallows a lot of optimizations based on signed overflow being undefined behaviour, which is a matter of language and compiler design. This says nothing about the cost of checked arithmetic itself on the CPU. | ||||||||
| ▲ | qayxc 2 days ago | parent [-] | |||||||
It does, though. UB and associated optimisations wouldn't be an issue if defined behaviour would not have an impact on performance. If the cost would be zero or negligible, the compiler wouldn't need to care and hence warnings like this wouldn't need to be explicitly stated. | ||||||||
| ||||||||