Pack alignment value (-pack-alignment-value
)
Specify default structure packing alignment for code developed in Visual C++
Description
Specify the default packing alignment (in bytes) for structures, unions, and class members.
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): In your project configuration, the option is on the Target & Compiler node of the Build tab.
Command line and
options file: Use
the option -pack-alignment-value
. See Command-Line Information.
Why Use This Option
If you use compiler options to specify how members of a structure are packed into memory, use this option to emulate your compiler.
For instance, if you use the Visual Studio® option /Zp to specify an alignment, use this option for your Polyspace® analysis.
If you use #pragma pack
directives in your code to specify alignment, and
also specify this option for analysis, the #pragma pack
directives take precedence.
Settings
Default: 8
You can enter one of these values:
1
2
4
8
16
Command-Line Information
Parameter: -pack-alignment-value |
Value: 1 | 2 | 4
| 8 | 16 |
Default: 8 |
Example (Bug Finder):
polyspace-bug-finder -compiler visual10 -pack-alignment-value
4 |
Example (Code Prover):
polyspace-code-prover -compiler visual10 -pack-alignment-value
4 |
Example (Bug Finder Server):
polyspace-bug-finder-server -compiler visual10 -pack-alignment-value
4 |
Example (Code Prover
Server):
polyspace-code-prover-server
-compiler visual10 -pack-alignment-value 4 |