When implementing an infinite loop, is there a difference in using while(1) vs for(;;) vs goto?
Thanks, Chenz
There is hardly any difference in generated assembly. It's more of an stylistic issue:
Goto - just ooogly: jumps backward, no explicit infinite block
while(1) - better, requires "dummy" condition though and you'll be often warned by compiler(warning level 4) or static analysis tool
for(;;) might not be the prettiest, but imho fits best because this construct cannot have any other meaning (compared to while). But some other people prefer while(1) for the "same" reason...