Main Content

Ignore pragma pack directives (-ignore-pragma-pack)

Ignore #pragma pack directives

Description

Specify that the analysis must ignore #pragma pack directives in the code.

Set Option

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

User interface (Polyspace Platform, desktop products only): This option is removed in the Polyspace platform user interface. If required, specify this option as an advanced option.

Command line and options file: Use the option -ignore-pragma-pack. See Command-Line Information.

Why Use This Option

Use this option if #pragma pack directives in your code cause linking errors.

For instance, you have two structures with the same name in your code, but one declaration follows a #pragma pack(2) statement. Because the default alignment is 8 bytes, the different packing for the two structures causes a linking error. Use this option to avoid such errors.

Settings

On

The analysis ignores the #pragma directives.

Off (default)

The analysis takes into account specifications in the #pragma directives.

Command-Line Information

Parameter: -ignore-pragma-pack
Default: Off
Example (Bug Finder): polyspace-bug-finder -ignore-pragma-pack
Example (Code Prover): polyspace-code-prover -ignore-pragma-pack
Example (Bug Finder Server): polyspace-bug-finder-server -ignore-pragma-pack
Example (Code Prover Server): polyspace-code-prover-server -ignore-pragma-pack