PC-lint/FlexeLint Output | Reference Manual Explanation | Home

            bug525.cpp

1     #include <stdio.h>
2
3     typedef const char *CSTRING;
4
5     CSTRING revere( int lights )
6         {
7         CSTRING manner = "by land";
8
9         if( lights > 0 )
10            if( lights == 2 ) manner = "by sea";
11
12        else manner = "";
13        return manner;
14        }
15
16    int main()
17        {
18        printf( "The British are coming %s\n", revere( 1 ) );
19        return 0;
20        }

American forces in 1775 were probably not using C in planning their military strategy but if they were the British might have slipped them this program to trip them up. Why would the message get botched?


bug525.cpp lint Output

--- Module:   bug525.cpp
    _
    else manner = "";
bug525.cpp(12) : Warning 525: Negative indentation from line 10

Reference Manual Explanation

525   Negative indentation from Location  -- The current line
      was found to be negatively indented (i.e., not indented as
      much) from the indicated line.  The latter corresponds to
      a clause introducing a control structure and statements
      and other control clauses and braces within its scope are
      expected to have no less indentation.  If tabs within your
      program are other than 8 blanks you should use the -t
      option.

If you have comments or questions about this bug, please post them to our   Discussion Forum

Previous Bug - Bug #1556 - June 2003

PC-lint/FlexeLint - Product Overview

Home | Contact | Order

PC-lint and FlexeLint are trademarks of Gimpel Software
Copyright 2003, Gimpel Software