avr-gcc-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-gcc-list] Feature request - compiler warning for "if"stmtsthat


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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]