Gollum@feddit.de to Programmer Humor@programming.dev · 10 months agoI mean it could be righti.imgur.comimagemessage-square19fedilinkarrow-up1247
arrow-up1233imageI mean it could be righti.imgur.comGollum@feddit.de to Programmer Humor@programming.dev · 10 months agomessage-square19fedilink
minus-squareHotzilla@sopuli.xyzlinkfedilinkarrow-up5·10 months agoWhat if int overflows? Is it still false?
minus-squarerhpp@programming.devlinkfedilinkarrow-up10·10 months agoStill false, thanks to compiler optimizations. Remember that integer overflow is UB. (unless you’re using unsigned int or a programming language which strictly defines integer overflow, possibly as an error) P.S.: Assuming this is C/C++
minus-squarechellomere@lemmy.worldlinkfedilinkarrow-up2·edit-210 months agoNo, because it’s UB, the compiler is free to do whatever, like making demons fly out of your nose
What if int overflows? Is it still false?
Still false, thanks to compiler optimizations. Remember that integer overflow is UB. (unless you’re using unsigned int or a programming language which strictly defines integer overflow, possibly as an error)
P.S.: Assuming this is C/C++
No, because it’s UB, the compiler is free to do whatever, like making demons fly out of your nose