Main Content

Forced includes (-include)

Specify files to be #include-d by every source file.

Since R2023b

Description

The option with this name is available only in the Polyspace Platform (Polyspace Test) user interface. For the equivalent option in the standard Polyspace® user interface, see Include (-include).

Specify files to be #include-d by every source file. These #include-s are added before preprocessing but the original sources are not modified. Use these files to define types, etc. that are not defined in the source code. This option is equivalent to the option Include (-include).

Set Option

User interface (Polyspace Platform, desktop products only): In your project configuration, the option is on the Build tab on the Target & Compiler node.

Command line: 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

Tips

During the build process, file-specific includes are merged with project level build configurations. Using this option with a CMAKE-based toolchain results in a warning.

Version History

Introduced in R2023b