3 ms·
When I see a snippet like this int temp = a * b; ngassert( abs(temp) >= abs(a), "overflow!" ); I wonder what stops the compiler from opt
by teo_zero 2y ago
When I see a snippet like this
int temp = a * b;
ngassert(
abs(temp) >= abs(a),
"overflow!"
);
I wonder what stops the compiler from optimizing away the assert, as it's clearly based on an undefined behavior.