You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Controls how the members of a structure are packed into memory and specifies the same packing for all structures in a module.
17
-
18
-
## Syntax
19
-
20
-
```
21
-
/Zp[1|2|4|8|16]
22
-
```
23
-
24
-
## Remarks
25
-
When you specify this option, each structure member after the first is stored on either the size of the member type or `n`-byte boundaries (where `n` is 1, 2, 4, 8, or 16), whichever is smaller.
26
-
27
-
The available values are described in the following table.
28
-
29
-
1
30
-
Packs structures on 1-byte boundaries. Same as **/Zp**.
31
-
32
-
2
33
-
Packs structures on 2-byte boundaries.
34
-
35
-
4
36
-
Packs structures on 4-byte boundaries.
37
-
38
-
8
39
-
Packs structures on 8-byte boundaries (default).
40
-
41
-
16
42
-
Packs structures on 16-byte boundaries.
43
-
44
-
You should not use this option unless you have specific alignment requirements.
45
-
46
-
You can also use [pack](../../preprocessor/pack.md) to control structure packing. For more information about alignment, see:
Controls how the members of a structure are packed into memory and specifies the same packing for all structures in a module.
18
+
19
+
## Syntax
20
+
21
+
> **/Zp**[**1**|**2**|**4**|**8**|**16**]
22
+
23
+
## Remarks
24
+
25
+
When you specify the **/Zp**_n_ option, each structure member after the first is stored on either the size of the member type or *n*-byte boundaries (where *n* is 1, 2, 4, 8, or 16), whichever is smaller.
26
+
27
+
The available packing values are described in the following table:
28
+
29
+
|/Zp argument|Effect|
30
+
|-|-|
31
+
|1|Packs structures on 1-byte boundaries. Same as **/Zp**.|
32
+
|2|Packs structures on 2-byte boundaries.|
33
+
|4|Packs structures on 4-byte boundaries.|
34
+
|8|Packs structures on 8-byte boundaries (default).|
35
+
|16| Packs structures on 16-byte boundaries.|
36
+
37
+
You should not use this option unless you have specific alignment requirements.
38
+
39
+
> [!WARNING]
40
+
> C++ headers in the Windows SDK assume **/Zp8** packing. Memory corruption may occur if the **/Zp** setting is changed when using Windows SDK headers.
41
+
42
+
You can also use [pack](../../preprocessor/pack.md) to control structure packing. For more information about alignment, see:
0 commit comments