build.htm

## Project Configuration Settings

Use the tabs of the Project Configuration to specify various project settings to be used during analysis.

· Sources tab - Specify the source files to be analyzed. Described in detail in previous section, Adding Source Files to a Project.
· Options tab - Specify additional information to customize the analysis, including whether to record local objects and parameters, whether to cache include files for re-use and to specify the compiler you use. You may also enable or disable the feature to prompt for missing include files during the analysis.
· Include Dirs tab - Specify the include paths to search. Any include files that you also want to be analyzed must also be specified in the Sources.
· Ignore Includes tab - Specify the include files that you do not wish to have references to.
· Macros tab - Define macros to be used when analyzing the project.
· MSVC tab - Use an MSVC projects settings See section on page 39.
· File Types tab - Specify how to handle the source files and what file extensions are used when there is a mix of C and C++ sources.

Refer to Adding Source Files to a Project for details about the Sources tab. The other Project Configuration tabs are discussed in the following sections.

### Project Options

Choose the Options tab in the Project Configuration dialog box to specify additional information to customize the analysis, including whether to record local objects and parameters, whether to cache include files for re-use, to note the compiler you use, and to enable or disable the prompting feature for missing include files.

- Prompt for Missing Includes
By default, for any include files that cannot be found during analysis, you will be prompted as to how to handle that missing include file. When prompted during analysis, you may choose to ignore the missing file, or you may specify the path where the file can be found. Turn this option off to disable this prompting feature. Any missing include files found during analysis when the prompt feature is turned off will be ignored.
- Record Local Object Declarations
By default, all local object declarations are included in the database. If you wish to exclude variables declared within functions from the database, turn this option off.
Local objects included for analysis can then be either included or excluded from the HTML output generated. Specify whether to include local objects in the HTML output on the main window of Understand for C++.
- Record Parameter References
If you wish to exclude cross reference information for parameters, turn this option off. By default, this option is on and all cross reference information for parameters is included.
- Include Cache
By default, include files are cached during the analysis phase as they are often referenced in multiple source files. This speeds up analysis, but also uses more memory. If you have problems with excessive memory use during analysis, turn this option off.
- Associate Comments
By default, source code comments found during analysis are not associated with an entity in any way. Select this option to have comments associated with an entity.
- Allow Nested Comments
By default, this is off. If turned on it permits C style (/* */) comments to be nested. This isn't permitted by the ANSI standard, but some compilers do permit it.
- Compiler
Select the compiler/platform that you use. This will set up compiler specific macros for use by the Understand for C++ parser.
Note: Not all features of a particular compiler extension will necessarily be handled.

### Include Paths

Choose the Include Dirs tab in the Project Configuration dialog to specify include paths. Specify any number of directory paths to search for include files used in the project. Include paths are not recursively searched, that is any subdirectories will not be searched for include files unless that subdirectory is explicitly specified in the list of include directories. Following is an example of the Include Dirs tab.

During analysis, the include path directories will be searched in the order that they appear in the dialog. Use the "Move Up" and "Move Down" buttons to re-order the include directories as desired.

Typically only include files that are not directly related to your project (such as system-level includes) and that you do not want to analyze fully are defined here. For project-level includes that you wish to be fully analyzed, be sure to add those include files as source files in the Sources tab.

### Ignore Includes

Choose the Ignore Includes tab in the Project Configuration dialog to specify individual include files that you wish to ignore during analysis.

Any files that you choose to ignore when prompted during analysis will be added to this list.

### Pre-Processor Macros (#define)

C source code is often sprinkled with pre-processor directives providing instructions and options to the C compiler. Directives such as:

#define INSTRUMENT_CODE
#ifdef INSTRUMENT_CODE
printf("Test case reached\n");
#endif

configure the software in ways that affect what it does and how it should be parsed.

Macros are often defined with directives (#define) in include files (.h files) or are passed in via the compiler (typically with the -D option).

For Understand for C++ to successfully analyze your C software it needs to know what macro definitions should be set to control actions of the pre-processor.

To define macros, select the Macros tab of the Project Configuration dialog:

The dialog manages a list of macros and their optional definitions. Each macro may be edited or deleted. Note that a macro must have a name, but that the definition is optional. This is commonly used in conjunction with #ifdef pre-processor conditional statements checking to see if macros are defined.

To edit the definition of an existing macro value but keep the same name, simply select the macro, modify the definition, and press Add.

To use an existing Macro as the basis for a new one, select the macro, edit the definition and the name, and then press Add. This will create a new macro.

### Specifying Macros and Include Paths in Bulk

Sometimes you have a lot of include paths and macros, or they are generated by some other process.

If so then you can specify a file prefixed by an @ sign.

For Macros the file is of the form:

#define foo bar
foo=bar
foo bar

All define a macro "foo" to be "bar".

For Include files, the file is just a list of directories in search order:

/usr/include/X11
/home/nelson/GUI

Note that these files can also be used with the command line analyzer "undc" described in Command Line Processing

### File Types

Use the File Types tab in the Project Configuration dialog to specify how source files should be parsed. If a mix of C and C++ sources are in the project, also specify the file extensions used for each type.

Tip: If your project is old C source which may have references to entities which are now used for C++ keywords, select C source only for parsing.

### Save Project Configuration

When the project is configured as desired, click on the Save button and the configuration will be saved.

Cancel will close the dialog without saving your changes.

Scientific Toolworks, Inc. http://www.scitools.com Voice: (802) 763-2995 Fax: (802) 763-3066 support@scitools.com sales@scitools.com