Main Content

Include (-include)

Specify files to be #include-ed by each C file in analysis

Description

Specify files to be #include-ed by each C file involved in the analysis. The software enters the #include statements in the preprocessed code used for analysis, but does not modify the original source code.

Set Option

User interface (desktop products only): In your project configuration, the option is on the Environment Settings node.

User interface (Polyspace Platform, desktop products only): In your project configuration, the option is on the Static Analysis tab on the Target & Compiler node and named as Forced includes.

Command line and options file: Use the option -include. See Command-Line Information.

Why Use This Option

There can be many reasons why you want to #include a file in all your source files.

For instance, you can collect in one header file all workarounds for compilation errors. Use this option to provide the header file for analysis. Suppose you have compilation issues because Polyspace® does not recognize certain compiler-specific keywords. To work around the issues, #define the keywords in a header file and provide the header file with this option.

Settings

No Default

Specify the file name to be included in every file involved in the analysis.

Polyspace still acts on other directives such as #include <include_file.h>.

Command-Line Information

Parameter: -include
Default: None
Value: file (Use -include multiple times for multiple files)
Example (Bug Finder): polyspace-bug-finder -include `pwd`/sources/a_file.h -include /inc/inc_file.h
Example (Code Prover): polyspace-code-prover -include `pwd`/sources/a_file.h -include /inc/inc_file.h
Example (Bug Finder Server): polyspace-bug-finder-server -include `pwd`/sources/a_file.h -include /inc/inc_file.h
Example (Code Prover Server): polyspace-code-prover-server -include `pwd`/sources/a_file.h -include /inc/inc_file.h