Interestingly though, C doesn't seem to allow an empty condition for while.
$ cat a.c int main() { while () { break; } return 0; } $ gcc a.c a.c: In function ‘main’: a.c:2: error: expected expression before ‘)’ token
It is well known to allow it for for. I read "for (;;)" as "for ever", and use it where some use while (1).
It could very well be unintentional, but fixing it could break code at no benefit.
In reply to Re^2: while () vs. while (1)
by ikegami
in thread while () vs. while (1)
by perl5ever
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |