KnowledgeBase Archive

An Archive of Early Microsoft KnowledgeBase Articles

View on GitHub

Q44417: CALLTREE Ignores Conditional Compilation Statements in Editor

Article: Q44417
Product(s): See article
Version(s): 1.00   | 1.00
Operating System(s): MS-DOS | OS/2
Keyword(s): ENDUSER | S_C H_MASM | mspl13_basic
Last Modified: 17-MAY-1989

The CALLTREE utility provided with the Microsoft Editor can be used to
produce a graphical call-tree listing of a project. The following
command line is an example of this utility. This command line creates
a file called CALLS.TXT showing the relationship of the functions
found in the four C source files shown below:

   calltree /c calls.txt main.c sub1.c sub2.c sub3.c

If any of the files use conditional compilation directives, these are
disregarded by CALLTREE and any functions that would not have been
called appear in the call listing. An example of code that produces a
misleading call listing is shown below. Although only one set of calls
is compiled, both sets show up in the file produced by CALLTREE.

    void main( void )
    {
    #ifdef DEBUG
        dshow();
        ddone();
    #else
        fshow();
        fdone();
    #endif
    }

To avoid this situation, a preprocessor listing should be produced
using the /P switch with CL, and CALLTREE should then be run on the
resultant file.

This is a limitation of the utility. CALLTREE is meant to be a
general-purpose tool for C and assembly programs, and is not designed
to do any parsing or syntax checking.

THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Copyright Microsoft Corporation 1986-2002.