Skip to content

Commit 30ab99c

Browse files
authored
Merge pull request #580 from MicrosoftDocs/master
2/2 AM Publish
2 parents 1e367a5 + 2670440 commit 30ab99c

32 files changed

+1666
-1549
lines changed

docs/build/common-visual-cpp-arm-migration-issues.md

Lines changed: 89 additions & 92 deletions
Large diffs are not rendered by default.
Lines changed: 42 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
---
22
title: "Compiler Options | Microsoft Docs"
33
ms.custom: ""
4-
ms.date: "11/04/2016"
4+
ms.date: "01/29/2018"
55
ms.reviewer: ""
66
ms.suite: ""
77
ms.technology: ["cpp-tools"]
88
ms.tgt_pltfrm: ""
99
ms.topic: "article"
1010
dev_langs: ["C++"]
11-
helpviewer_keywords: ["cl.exe compiler", "IPF Visual C++ compiler", "Itanium Visual C++ compiler", "compiler options, C++", "x64 Visual C++ compiler"]
11+
helpviewer_keywords: ["cl.exe compiler", "x86 Visual C++ compiler", "ARM Visual C++ compiler", "compiler options, C++", "x64 Visual C++ compiler"]
1212
ms.assetid: ed3376c8-bef4-4c9a-80e9-3b5da232644c
1313
caps.latest.revision: 18
1414
author: "corob-msft"
@@ -17,42 +17,43 @@ manager: "ghogen"
1717
ms.workload: ["cplusplus"]
1818
---
1919
# Compiler Options
20-
cl.exe is a tool that controls the Microsoft C and C++ compilers and linker. cl.exe can be run only on operating systems that support Microsoft Visual Studio.
21-
22-
> [!NOTE]
23-
> You can start this tool only from the [!INCLUDE[vsprvs](../../assembler/masm/includes/vsprvs_md.md)] command prompt. You cannot start it from a system command prompt or from File Explorer.
24-
25-
The compilers produce Common Object File Format (COFF) object (.obj) files. The linker produces executable (.exe) files or dynamic-link libraries (DLLs).
26-
27-
Note that all compiler options are case sensitive.
28-
29-
To compile without linking, use [/c](../../build/reference/c-compile-without-linking.md).
30-
31-
## Finding an Option
32-
To find a particular compiler option, see one of the following lists:
33-
34-
- [Compiler Options Listed Alphabetically](../../build/reference/compiler-options-listed-alphabetically.md)
35-
36-
- [Compiler Options Listed by Category](../../build/reference/compiler-options-listed-by-category.md)
37-
38-
## Specifying Options
39-
The topic for each compiler option discusses how it can be set in the development environment. For information on specifying options outside the development environment, see:
40-
41-
- [Compiler Command-Line Syntax](../../build/reference/compiler-command-line-syntax.md)
42-
43-
- [CL Command Files](../../build/reference/cl-command-files.md)
44-
45-
- [CL Environment Variables](../../build/reference/cl-environment-variables.md)
46-
47-
## Related Build Tools
48-
Use [NMAKE](../../build/nmake-reference.md) to build your output file.
49-
50-
Use [BSCMAKE](../../build/reference/bscmake-reference.md) to support class browsing.
51-
52-
[Linker options](../../build/reference/linker-options.md) also affect how your program is built.
53-
54-
## See Also
55-
[C/C++ Building Reference](../../build/reference/c-cpp-building-reference.md)
56-
[Setting Compiler Options](../../build/reference/setting-compiler-options.md)
57-
[Fast Compilation](../../build/reference/fast-compilation.md)
58-
[CL Invokes the Linker](../../build/reference/cl-invokes-the-linker.md)
20+
21+
cl.exe is a tool that controls the Microsoft Visual C++ (MSVC) C and C++ compilers and linker. cl.exe can be run only on operating systems that support Microsoft Visual Studio for Windows.
22+
23+
> [!NOTE]
24+
> You can start this tool only from a Visual Studio developer command prompt. You cannot start it from a system command prompt or from File Explorer. For more information, see [Build C/C++ code on the command line](../building-on-the-command-line.md).
25+
26+
The compilers produce Common Object File Format (COFF) object (.obj) files. The linker produces executable (.exe) files or dynamic-link libraries (DLLs).
27+
28+
Note that all compiler options are case sensitive. You may use either a forward slash (`/`) or a dash (`-`) to specify a compiler option.
29+
30+
To compile without linking, use the [/c](../../build/reference/c-compile-without-linking.md) option.
31+
32+
## Find a compiler option
33+
34+
To find a particular compiler option, see one of the following lists:
35+
36+
- [Compiler Options Listed Alphabetically](../../build/reference/compiler-options-listed-alphabetically.md)
37+
38+
- [Compiler Options Listed by Category](../../build/reference/compiler-options-listed-by-category.md)
39+
40+
## Specify compiler options
41+
42+
The topic for each compiler option discusses how it can be set in the development environment. For information on specifying options outside the development environment, see:
43+
44+
- [Compiler Command-Line Syntax](../../build/reference/compiler-command-line-syntax.md)
45+
46+
- [CL Command Files](../../build/reference/cl-command-files.md)
47+
48+
- [CL Environment Variables](../../build/reference/cl-environment-variables.md)
49+
50+
## Related build tools
51+
52+
[Linker options](../../build/reference/linker-options.md) also affect how your program is built.
53+
54+
## See also
55+
56+
[C/C++ Building Reference](../../build/reference/c-cpp-building-reference.md)
57+
[Setting Compiler Options](../../build/reference/setting-compiler-options.md)
58+
[Fast Compilation](../../build/reference/fast-compilation.md)
59+
[CL Invokes the Linker](../../build/reference/cl-invokes-the-linker.md)

docs/build/reference/volatile-volatile-keyword-interpretation.md

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -18,39 +18,39 @@ manager: "ghogen"
1818
ms.workload: ["cplusplus"]
1919
---
2020
# /volatile (volatile Keyword Interpretation)
21-
Specifies how the [volatile](../../cpp/volatile-cpp.md) keyword is to be interpreted.
22-
23-
## Syntax
24-
25-
```
26-
/volatile:{iso|ms}
27-
```
28-
29-
## Arguments
30-
**/volatile:iso**
31-
Selects strict `volatile` semantics as defined by the ISO-standard C++ language. Acquire/release semantics are not guaranteed on volatile accesses. If the compiler targets ARM, this is the default interpretation of `volatile`.
32-
33-
**/volatile:ms**
34-
Selects Microsoft extended `volatile` semantics, which add memory ordering guarantees beyond the ISO-standard C++ language. Acquire/release semantics are guaranteed on volatile accesses. However, this option also forces the compiler to generate hardware memory barriers, which might add significant overhead on ARM and other weak memory-ordering architectures. If the compiler targets any platform except ARM, this is default interpretation of `volatile`.
35-
36-
## Remarks
37-
We strongly recommend that you use **/volatile:iso** along with explicit synchronization primitives and compiler intrinsics when you are dealing with memory that is shared across threads. For more information, see [volatile](../../cpp/volatile-cpp.md).
38-
39-
If you port existing code or change this option in the middle of a project, it may be helpful to enable warning [C4746](../../error-messages/compiler-warnings/compiler-warning-c4746.md) to identify code locations that are affected by the difference in semantics.
40-
41-
There is no `#pragma` equivalent to control this option.
42-
43-
### To set the /volatile compiler option in Visual Studio
44-
45-
1. Open the **Property Pages** dialog box for the project. For more information, see [Working with Project Properties](../../ide/working-with-project-properties.md).
46-
47-
2. Select the **C/C++** folder.
48-
49-
3. Select the **Command Line** property page.
50-
51-
4. In the **Additional options** box, add `/volatile:iso` or `/volatile:ms`.
52-
53-
## See Also
54-
[volatile](../../cpp/volatile-cpp.md)
55-
[Compiler Options](../../build/reference/compiler-options.md)
56-
[Setting Compiler Options](../../build/reference/setting-compiler-options.md)
21+
22+
Specifies how the [volatile](../../cpp/volatile-cpp.md) keyword is to be interpreted.
23+
24+
## Syntax
25+
26+
> **/volatile:**{**iso**|**ms**}
27+
28+
## Arguments
29+
30+
**/volatile:iso**
31+
Selects strict `volatile` semantics as defined by the ISO-standard C++ language. Acquire/release semantics are not guaranteed on volatile accesses. If the compiler targets ARM, this is the default interpretation of `volatile`.
32+
33+
**/volatile:ms**
34+
Selects Microsoft extended `volatile` semantics, which add memory ordering guarantees beyond the ISO-standard C++ language. Acquire/release semantics are guaranteed on volatile accesses. However, this option also forces the compiler to generate hardware memory barriers, which might add significant overhead on ARM and other weak memory-ordering architectures. If the compiler targets any platform except ARM, this is default interpretation of `volatile`.
35+
36+
## Remarks
37+
38+
We strongly recommend that you use **/volatile:iso** along with explicit synchronization primitives and compiler intrinsics when you are dealing with memory that is shared across threads. For more information, see [volatile](../../cpp/volatile-cpp.md).
39+
40+
If you port existing code or change this option in the middle of a project, it may be helpful to enable warning [C4746](../../error-messages/compiler-warnings/compiler-warning-c4746.md) to identify code locations that are affected by the difference in semantics.
41+
42+
There is no `#pragma` equivalent to control this option.
43+
44+
### To set the /volatile compiler option in Visual Studio
45+
46+
1. Open the **Property Pages** dialog box for the project. For more information, see [Working with Project Properties](../../ide/working-with-project-properties.md).
47+
48+
1. Select the **Configuration Properties** > **C/C++** > **Command Line** property page.
49+
50+
1. In the **Additional options** box, add **/volatile:iso** or **/volatile:ms** and then choose **OK** or **Apply** to save your changes.
51+
52+
## See also
53+
54+
[volatile](../../cpp/volatile-cpp.md)
55+
[Compiler Options](../../build/reference/compiler-options.md)
56+
[Setting Compiler Options](../../build/reference/setting-compiler-options.md)

docs/build/reference/yl-inject-pch-reference-for-debug-library.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: "-Yl (Inject PCH Reference for Debug Library) | Microsoft Docs"
33
ms.custom: ""
4-
ms.date: "12/04/2017"
4+
ms.date: "01/29/2018"
55
ms.reviewer: ""
66
ms.suite: ""
77
ms.technology: ["cpp-tools"]
@@ -18,7 +18,7 @@ ms.workload: ["cplusplus"]
1818
---
1919
# /Yl (Inject PCH Reference for Debug Library)
2020

21-
The **/Yl** option creates a common symbol for a precompiled header file and injects references to this symbol in all files that use the precompiled header. This makes the complete type information for precompiled header symbols available to the debugger in all files that use the precompiled header. This option is enabled by default. Use of this option can prevent linker errors due to missing debug information in linked libraries that use precompiled headers.
21+
The **/Yl** option generates a unique symbol in a precompiled header file, and a reference to this symbol is injected in all object files that use the precompiled header.
2222

2323
## Syntax
2424

@@ -29,20 +29,22 @@ The **/Yl** option creates a common symbol for a precompiled header file and inj
2929
### Arguments
3030

3131
*name*
32-
An optional name used to define a symbol to be stored and referenced in object files that define or use the precompiled header.
32+
An optional name used as part of the unique symbol.
3333

3434
*\-*
3535
A dash (-) explicitly disables the **/Yl** compiler option.
3636

3737
## Remarks
3838

39-
The **/Yl** option enables the debugger to get complete information about types in a precompiled header in every file that includes the precompiled header. This option creates an internal symbol name, injects the symbol definition in the object file used to create the precompiled header by the [/Yc](../../build/reference/yc-create-precompiled-header-file.md) option, and injects a reference to the symbol in all files that include the precompiled header by using the [/Yu](../../build/reference/yu-use-precompiled-header-file.md) compiler option. Because all source files that use the precompiled header refer to the named symbol, the linker always links the object file that defines the symbol and the associated precompiled header debugging information. This option is enabled by default.
39+
The **/Yl** compiler option creates a unique symbol definition in a precompiled header file created by using the [/Yc](../../build/reference/yc-create-precompiled-header-file.md) option. References to this symbol are automatically injected in all files that include the precompiled header by using the [/Yu](../../build/reference/yu-use-precompiled-header-file.md) compiler option. The **/Yl** option is enabled by default when **/Yc** is used to create a precompiled header file.
4040

41-
The **/Yl**_name_ option is used to explicitly create the identifying symbol for the precompiled header file. The compiler uses the *name* argument to create a symbol similar to \_\_@@\_PchSym\_@00@...@*name*, where the ellipsis (...) represents a linker-generated character string. If the argument is omitted, the compiler generates a symbol name automatically.
41+
The **/Yl**_name_ option is used to create an identifiable symbol in the precompiled header file. The compiler uses the *name* argument as part of the decorated symbol name it creates, similar to \_\_@@\_PchSym\_@00@...@*name*, where the ellipsis (...) represents a unique compiler-generated character string. If the *name* argument is omitted, the compiler generates a symbol name automatically. Normally, you do not need to know the name of the symbol. However, when your project uses more than one precompiled header file, the **/Yl**_name_ option may be useful to determine which object files use which precompiled header. You can use *name* as a search string to find the symbol reference in a dump file.
4242

43-
**/Yl-** disables the default behavior and does not put an identifying symbol reference in the object files that include the precompiled header. This option may be required for files compiled without the precompiled header file present.
43+
**/Yl-** disables the default behavior and does not put an identifying symbol in the precompiled header file. Compiled files that include this precompiled header do not get a common symbol reference.
4444

45-
If you use **/Yl-**, **/Yc** and [/Z7](../../build/reference/z7-zi-zi-debug-information-format.md) options to build a library, the compiler creates a precompiled header file that contains debugging information that is stored in an object file rather than a .pdb file. [LNK1211](../../error-messages/tool-errors/linker-tools-error-lnk1211.md) errors or [LNK4206](../../error-messages/tool-errors/linker-tools-warning-lnk4206.md) warnings can occur in builds that use this library and the precompiled header if the source file used to create the precompiled header does not define any symbols. The linker may exclude this library object file from the link, along with the associated precompiled header debug information, when nothing in the object file is referenced in the library client. To solve the problem, specify **/Yl** when you use **/Yc** to create a precompiled header file and **/Yu** to use it. This ensures that the object file that contains the debugging information is included in your build.
45+
When **/Yc** is not specified, any **/Yl** option has no effect, but if specified it must match any **/Yl** option passed when **/Yc** is specified.
46+
47+
If you use **/Yl-**, **/Yc** and [/Z7](../../build/reference/z7-zi-zi-debug-information-format.md) options to build a precompiled header file, the debugging information is stored in the object file for the source file used to create the precompiled header, rather than a separate .pdb file. If this object file is then made part of a library, [LNK1211](../../error-messages/tool-errors/linker-tools-error-lnk1211.md) errors or [LNK4206](../../error-messages/tool-errors/linker-tools-warning-lnk4206.md) warnings can occur in builds that use this library and the precompiled header file, if the source file used to create the precompiled header file does not define any symbols itself. The linker may exclude the object file from the link, along with the associated debugging information, when nothing in the object file is referenced in the library client. To solve this problem, specify **/Yl** (or remove the **/Yl-** option) when you use **/Yc** to create the precompiled header file. This ensures that the object file from the library that contains the debugging information gets linked in your build.
4648

4749
For more information on precompiled headers, see:
4850

@@ -54,7 +56,7 @@ For more information on precompiled headers, see:
5456

5557
1. Open the project's **Property Pages** dialog box. For details, see [Working with Project Properties](../../ide/working-with-project-properties.md).
5658

57-
1. Choose the **Command Line** property page in the **C/C++** folder.
59+
1. Select the **Configuration Properties** > **C/C++** > **Command Line** property page.
5860

5961
1. Add the **/Yl**_name_ compiler option in the **Additional Options** box. Choose **OK** to save your changes.
6062

0 commit comments

Comments
 (0)