|
From: | Dave Hansen |
Subject: | Re: [avr-gcc-list] Should this code work? 4.1.1 |
Date: | Mon, 05 Mar 2007 10:40:23 -0500 |
From: "Graham Davies" <address@hidden>
Bob Paddock wrote:
[...]
I don't see while(true){} being any different than for(;;){} in this context, and while(true){} causes the Lint error of "evaluation of constant value boolean".
[...]
I can't see why Lint would consider this an error and for ( ; ; ) not. Even so, isn't there some markup you can add in a comment to reassure Lint that this is what you intend?
FWIW, assuming you're discussing PC-lint...PC-lint considers "for (;;)" to be the "traditional" or "conventional" way to express an endless loop, and therefore does not comment on it. Personally, I use "while (1)" or "while(TRUE)" more often, and indeed, PC-lint warns about that, perhaps to catch mistakes of the form of "while (Flag)" where Flag is a preprocessor macro that expands into a constant. To suppress that warning for your entire program, use -e716, or disable on the line you use it with a lint comment like /*lint !e716 */.
Regards, -=Dave _________________________________________________________________With tax season right around the corner, make sure to follow these few simple tips. http://articles.moneycentral.msn.com/Taxes/PreparationTips/PreparationTips.aspx?icid=HMFebtagline
[Prev in Thread] | Current Thread | [Next in Thread] |