When implementing an infinite loop, is there a difference in using while(1) vs for(;;) vs goto?
Thanks, Chenz
Although there's no significant difference as mentioned in the other posts, a common reason to use for (;;) instead of while (1) is that static analysis tools (and some compilers with certain warning levels) often complain about the while loop.
Goto is a bit nasty, but should produce the same code as the others. Personally, I stick to for (;;) (to keep Lint happy), but I have no problem with while (1).