Skip to content

Commit 2f8606d

Browse files
author
mikeblome
committed
fixed merge conflict
2 parents 49b9737 + 7439439 commit 2f8606d

File tree

2,043 files changed

+1650
-11689
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

2,043 files changed

+1650
-11689
lines changed

docs/TOC.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
# [Security Best Practices for C++](security/security-best-practices-for-cpp.md)
2727
## [Running as a Member of the Users Group](security/running-as-a-member-of-the-users-group.md)
2828
## [How User Account Control (UAC) Affects Your Application](security/how-user-account-control-uac-affects-your-application.md)
29+
## [C++ Developer Guidance for Speculative Execution Side Channels](security/developer-guidance-speculative-execution.md)
2930
# [Visual C++ Samples](visual-cpp-samples.md)
3031
# [Visual C++ Help and Community](visual-cpp-help-and-community.md)
3132
# [How to Report a Problem with the Visual C++ Toolset](how-to-report-a-problem-with-the-visual-cpp-toolset.md)
Lines changed: 53 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: "-Zp (Struct Member Alignment) | Microsoft Docs"
33
ms.custom: ""
4-
ms.date: "11/04/2016"
4+
ms.date: "04/30/2018"
55
ms.technology: ["cpp-tools"]
66
ms.topic: "reference"
77
f1_keywords: ["/zp", "VC.Project.VCCLCompilerTool.StructMemberAlignment", "VC.Project.VCCLWCECompilerTool.StructMemberAlignment"]
@@ -13,60 +13,55 @@ ms.author: "corob"
1313
ms.workload: ["cplusplus"]
1414
---
1515
# /Zp (Struct Member Alignment)
16-
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:
47-
48-
- [align](../../cpp/align-cpp.md)
49-
50-
- [__alignof Operator](../../cpp/alignof-operator.md)
51-
52-
- [__unaligned](../../cpp/unaligned.md)
53-
54-
- [Examples of Structure Alignment](../../build/examples-of-structure-alignment.md) (x64 specific)
55-
56-
### To set this compiler option in the Visual Studio development environment
57-
58-
1. Open the project's **Property Pages** dialog box. For details, see [Working with Project Properties](../../ide/working-with-project-properties.md).
59-
60-
2. Click the **C/C++** folder.
61-
62-
3. Click the **Code Generation** property page.
63-
64-
4. Modify the **Struct Member Alignment** property.
65-
66-
### To set this compiler option programmatically
67-
68-
- See <xref:Microsoft.VisualStudio.VCProjectEngine.VCCLCompilerTool.StructMemberAlignment%2A>.
69-
70-
## See Also
71-
[Compiler Options](../../build/reference/compiler-options.md)
72-
[Setting Compiler Options](../../build/reference/setting-compiler-options.md)
16+
17+
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:
43+
44+
- [align](../../cpp/align-cpp.md)
45+
46+
- [__alignof Operator](../../cpp/alignof-operator.md)
47+
48+
- [__unaligned](../../cpp/unaligned.md)
49+
50+
- [Examples of Structure Alignment](../../build/examples-of-structure-alignment.md) (x64 specific)
51+
52+
### To set this compiler option in the Visual Studio development environment
53+
54+
1. Open the project's **Property Pages** dialog box. For details, see [Working with Project Properties](../../ide/working-with-project-properties.md).
55+
56+
1. Select the **C/C++** > **Code Generation** property page.
57+
58+
1. Modify the **Struct Member Alignment** property.
59+
60+
### To set this compiler option programmatically
61+
62+
- See <xref:Microsoft.VisualStudio.VCProjectEngine.VCCLCompilerTool.StructMemberAlignment%2A>.
63+
64+
## See also
65+
66+
- [Compiler Options](../../build/reference/compiler-options.md)
67+
- [Setting Compiler Options](../../build/reference/setting-compiler-options.md)

0 commit comments

Comments
 (0)