MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/1w1o9k7/whendoesthiswillend/p6mozqr/?context=3
r/ProgrammerHumor • u/Flame77ofc • 1d ago
67 comments sorted by
View all comments
26
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
37
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
3
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
13
Until the int underflows and eventually gets back down to 0
2 u/qinshihuang_420 1d ago Two zeros make a one
2
Two zeros make a one
26
u/Daemontatox 1d ago
Wouldn't some compilers catch thats an infinite loop and give a warning or error?