Click on image to see enlargment

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

            bug750.cpp

1    #include <stdio.h>
2
3    #define ON_THE_ROCKS
4
5    const char *ice()
6        {
7    #if defined(Shaken)
8        return "shaken not stirred";
9    #elif defined(Stirred)
10       return "stirred not shaken";
11   #elif defined(ON_THE_R0CKS)
12       return "on the rocks";
13   #else
14       return "";
15   #endif
16       }
17
18   int main()
19       {
20       printf( "Celebrate the New Year " );
21       printf( "with your drink %s.\n", ice() );
22       return 0;
23       }

The New Year's celebration was marred by the lack of ice for the drinks. The compiler made no complaint. Can you discover the problem?


bug750.cpp lint Output

--- Module:   bug750.cpp (C++)

    --- Wrap-up for Module: bug750.cpp

Info 750: local macro 'ON_THE_ROCKS' (line 3, file bug750.cpp) not referenced

Reference Manual Explanation


750    local macro 'Symbol' (Location) not referenced  -- A 'local'
       macro is one that is not defined in a header file.  The macro was
       not referenced throughout the module in which it is defined.

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

Previous Bug - Bug #418 - December 2005

[ new ] Use our Interactive Demo to Run FlexeLint on our Bugs of the Month

PC-lint/FlexeLint - Product Overview

Home | Contact | Order

PC-lint and FlexeLint are trademarks of Gimpel Software
Copyright 2007, Gimpel Software, All rights reserved.