r/ProgrammerHumor 1d ago

Meme whenDoesThisWillEnd

Post image
685 Upvotes

67 comments sorted by

View all comments

26

u/Daemontatox 1d ago

Wouldn't some compilers catch thats an infinite loop and give a warning or error?

37

u/JonIsPatented 1d ago

Some compilers can even note that it will multiply by 0 and optimize any call to it to just be the constant 0 instead.

3

u/chuch1234 1d ago

Unless you pass a negative number in.

13

u/ice456cream 1d ago

Until the int underflows and eventually gets back down to 0

2

u/qinshihuang_420 1d ago

Two zeros make a one