[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avr-gcc-list] Feature request - compiler warning for"if"stmtsthat d
From: |
David Breeze |
Subject: |
Re: [avr-gcc-list] Feature request - compiler warning for"if"stmtsthat do nothing |
Date: |
Tue, 14 Dec 2004 14:42:44 +0000 |
>>> "Graham Davies" <address@hidden> 14 December 2004 14:33:44 >>>
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.
Better! Also for those of us where safety is an issue "continue" and "break"
statements from while or for loops are to say the least frowned upon/banned.
See MISRA guidelines.
David Breeze
_______________________________________________
avr-gcc-list mailing list
address@hidden
http://www.avr1.org/mailman/listinfo/avr-gcc-list
This email and any files transmitted with it are confidential and intended
solely for the use of the individual or entity to whom they are addressed. If
an addressing or transmission error has misdirected
this e-mail, please notify the author by replying to this e-mail. If you are
not the intended recipient you must not use, disclose, copy, print or rely on
this e-mail.
Joy Mining Machinery Limited/P&H Minepro Services aims to prevent the
propagation of viruses, but cannot guarantee that this email is virus free.
You are advised to scan all attachments and open them at your own risk.
Joy Mining Machinery Limited/P&H Minepro Services may monitor outgoing and
incoming e-mails and other telecommunications on its e-mail and
telecommunication systems.
<<Privacy - UK>>
- Re: [avr-gcc-list] Feature request - compiler warning for"if"stmtsthat do nothing,
David Breeze <=