|
![]() Click on image to see enlargment |
|
PC-lint/FlexeLint Output | Reference Manual Explanation | Home bug722.cpp
The programmer wrote the fill_upper() function to fill in the upper reaches of the array a[]. With an argument of 8 he expected to fill a[8] and a[9] with the value 22. When printing the array only a[9] appeared to be filled in. What's going wrong? bug722.cpp lint Output
--- Module: bug722.cpp
_
for( j = 0; j < from; j++ );
bug722.cpp(10) : Info 722: Suspicious use of ;
_
a[j] = 0;
bug722.cpp(11) : Warning 539: Did not expect positive indentation from line 10
Reference Manual Explanation
722 Suspicious use of ; -- A semi-colon was found immediately to
the right of a right parenthesis in a construct of the form
while(e); or for(e;e;e); As such it may be overlooked or
confused with the use of semi-colons to terminate statements.
The message will be inhibited if the ';' is separated by at
least one blank from the ')'. Better, place it on a separate line.
If you have comments or questions about this bug, please post them to our Discussion Forum |
Previous Bug - Bug #1509 - August 2005