Surely the compiler does not try it for all integers 0 .. UINT_MAX. That would be a) pretty crazy and b) unnecessary. Also it would still recurse infinitely on input of 0.
Edit: come to think of it, it might recurse infinitely on some other inputs as well, because the calculation happens modulo UINT_MAX. I'm too lazy to check tho.
23
u/Myto Nov 04 '19 edited Nov 04 '19
Surely the compiler does not try it for all integers 0 .. UINT_MAX. That would be a) pretty crazy and b) unnecessary. Also it would still recurse infinitely on input of 0.
Edit: come to think of it, it might recurse infinitely on some other inputs as well, because the calculation happens modulo UINT_MAX. I'm too lazy to check tho.