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

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

Re: [avr-gcc-list] Should this code work? 4.1.1


From: Graham Davies
Subject: Re: [avr-gcc-list] Should this code work? 4.1.1
Date: Fri, 02 Mar 2007 21:29:52 -0500

Bob Paddock wrote:
< for(;;){} is a endless loop, how is "until execution of that
block ends in any way." being fulfilled here?

The block begins with the open brace and ends with the close brace. The block ends when control falls out of the bottom and for ( ; ; ) takes over for the next iteration. Personally, I never write for ( ; ; ), pretty much becase it leads to this kind of confusion. You can't *see* what is being executed. If instead you write while ( true ) it is easier to see where control goes when it leaves the block at the bottom.

Graham.






reply via email to

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