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

Set the option using one of these methods:

  • Polyspace® user interface (desktop products only): In your project configuration, select the Target & Compiler node and then select this option.

  • Polyspace Platform user interface (desktop products only): This option is not available in a Polyspace Platform project. If required, specify the command-line version of the option as an advanced option. For more information on how to specify advanced options in the user interface, see Other.

  • 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