|
From: | Graham Davies |
Subject: | Re: [avr-gcc-list] Feature request - compiler warning for "if"stmtsthat do nothing |
Date: | Tue, 14 Dec 2004 09:33:44 -0500 |
People wrote: > I hate it when I see an empty loop done as > while (*a++ = *b++); > > It makes it so much more obvious ... when you ... do > while (*a++ = *b++) > ; > > Or even better > while (*a++ = *b++) > ; /* empty */ > > My preference is something like > while (*dst++ = *src++) > continue; I can't resist any longer. I always do this: while ( *a++ = *b++ ) { } This seems to me to state clearly that I haven't forgotten the body and that I intend it to be empty. Graham.
[Prev in Thread] | Current Thread | [Next in Thread] |