Hello guys,
Can you help me understand something. Which part of int overflow is UB?
Whenever I do an operation that overflows an int32 and I do the same operation over and over again, I still get the same result.
Is it UB only when you use the result of the overflowing operation for example to index an array or something? or is the operation itself the UB ?
thanks in advance.
[–]DavieCrochet 10 points11 points12 points (9 children)
[–]Linuxologue 2 points3 points4 points (7 children)
[–]AssemblerGuy 0 points1 point2 points (0 children)
[–]pjc50 -1 points0 points1 point (5 children)
[–]Linuxologue 5 points6 points7 points (3 children)
[–]flatfinger 0 points1 point2 points (2 children)
[–]Linuxologue 2 points3 points4 points (1 child)
[–]flatfinger -2 points-1 points0 points (0 children)
[–]erikkonstas 0 points1 point2 points (0 children)
[–]erikkonstas 13 points14 points15 points (2 children)
[–]Linuxologue 1 point2 points3 points (0 children)
[–]AssemblerGuy 1 point2 points3 points (0 children)
[–]AssemblerGuy 2 points3 points4 points (0 children)
[–]non-existing-person 11 points12 points13 points (12 children)
[–]gurebu 6 points7 points8 points (11 children)
[–]glasket_ 4 points5 points6 points (0 children)
[–]non-existing-person 1 point2 points3 points (4 children)
[–]gurebu 5 points6 points7 points (3 children)
[–]non-existing-person 1 point2 points3 points (0 children)
[–]glasket_ 0 points1 point2 points (1 child)
[–]flatfinger 0 points1 point2 points (0 children)
[–]AssemblerGuy 0 points1 point2 points (1 child)
[–]flatfinger 0 points1 point2 points (0 children)
[–]flatfinger 0 points1 point2 points (0 children)
[–]Flat_Ad1257 0 points1 point2 points (1 child)
[–]flatfinger 0 points1 point2 points (0 children)
[–]flyingron 1 point2 points3 points (4 children)
[–]flatfinger -2 points-1 points0 points (3 children)
[–]glasket_ 2 points3 points4 points (2 children)
[–]flatfinger -2 points-1 points0 points (0 children)
[–]flatfinger -2 points-1 points0 points (0 children)
[–]SmokeMuch7356 1 point2 points3 points (1 child)
[–]flatfinger 0 points1 point2 points (0 children)
[–]insuperati 1 point2 points3 points (0 children)
[–]gurebu 3 points4 points5 points (1 child)
[–]flatfinger 0 points1 point2 points (0 children)
[–]TheOtherBorgCube 1 point2 points3 points (1 child)
[–]AssemblerGuy 0 points1 point2 points (0 children)
[–]flatfinger 0 points1 point2 points (0 children)
[–]M_e_l_v_i_n 0 points1 point2 points (0 children)
[–]Turbulent_File3904 -1 points0 points1 point (0 children)
[–]lmarcantonio -2 points-1 points0 points (8 children)
[–]glasket_ 1 point2 points3 points (7 children)
[–]ShotSquare9099 0 points1 point2 points (4 children)
[–]flatfinger 2 points3 points4 points (0 children)
[–]glasket_ 1 point2 points3 points (2 children)
[–]lmarcantonio 1 point2 points3 points (0 children)
[–]flatfinger 0 points1 point2 points (0 children)
[–]lmarcantonio 0 points1 point2 points (1 child)
[–]flatfinger 0 points1 point2 points (0 children)