Skip to content

Commit 17d1a43

Browse files
authored
Merge pull request MicrosoftDocs#116 from Microsoft/cr-build-error
Add missing /Zc option topics
2 parents 03eac42 + 6d5929e commit 17d1a43

6 files changed

+367
-43
lines changed

docs/build/reference/fa-fa-listing-file.md

Lines changed: 43 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: "-FA, -Fa (Listing File) | Microsoft Docs"
2+
title: "/FA, /Fa (Listing File) | Microsoft Docs"
33
ms.custom: ""
44
ms.date: "11/04/2016"
55
ms.reviewer: ""
@@ -45,54 +45,68 @@ translation.priority.ht:
4545
- "zh-tw"
4646
---
4747
# /FA, /Fa (Listing File)
48-
Creates a listing file containing assembly code.
48+
Creates a listing file containing assembler code.
4949

5050
## Syntax
5151

52-
```
53-
/FA[c|s|u]
54-
/Fapathname
55-
```
52+
`/FA`[`c`\][`s`\][`u`]
53+
`/Fa`_pathname_
5654

5755
## Remarks
58-
The arguments control the generation of source code and machine code and the extension of the listing file.
56+
The `/FA` compiler option generates an assembler listing file for each translation unit in the compilation, which generally corresponds to a C or C++ source file. By default, only assembler is included in the listing file, which is encoded as ANSI. The optional `c`, `s`, and `u` arguments to `/FA` control whether machine code or source code are output together with the assembler listing, and whether the listing is encoded as UTF-8.
57+
58+
By default, each listing file gets the same base name as the source file, and has a .asm extension. When machine code is included by using the `c` option, the listing file has a .cod extension. You can change the name and extension of the listing file and the directory where it is created by using the `/Fa` option.
59+
60+
### /FA arguments
61+
none
62+
Only assembler language is included in the listing.
63+
64+
`c`
65+
Optional. Includes machine code in the listing.
66+
67+
`s`
68+
Optional. Includes source code in the listing.
69+
70+
`u`
71+
Optional. Encodes the listing file in UTF-8 format, and includes a byte order marker. By default, the file is encoded as ANSI. Use `u` to create a listing file that displays correctly on any system, or if you are using Unicode source code files as input to the compiler.
72+
73+
If both `s` and `u` are specified, and if a source code file uses a Unicode encoding other than UTF-8, then the code lines in the .asm file may not display correctly.
74+
75+
### /Fa argument
76+
none
77+
One *source*.asm file is created for each source code file in the compilation.
78+
79+
*filename*
80+
A listing file named *filename*.asm is placed in the current directory. This is only valid when compiling a single source code file.
5981

60-
The following table describes the various values to **/FA**. It is possible to specify more than one value to **/FA**. For example, you can specify **/FAsu**.
82+
*filename.extension*
83+
A listing file named *filename.extension* is placed in the current directory. This is only valid when compiling a single source code file.
6184

62-
|Option|Listing contents and file extension|
63-
|------------|-----------------------------------------|
64-
|**/FA**|Assembly code; .asm|
65-
|**/FAc**|Machine and assembly code; .cod|
66-
|**/FAs**|Source and assembly code; .asm<br /><br /> If **/FAcs** is specified, the file extension will be .cod|
67-
|**/FAu**|Causes the output file to be created in UTF-8 format, with a byte order marker. By default, the file encoding is ANSI, but use **/FAu** if you want a listing file that displays correctly on any system, or if you are using Unicode source code files as input to the compiler.<br /><br /> If **/FAsu** is specified, and if a source code file uses Unicode encoding other than UTF-8, then the code lines in the .asm file may not display correctly.|
85+
*directory*\
86+
One *source_file*.asm file is created and placed in the specified *directory* for each source code file in the compilation. Note the required trailing backslash. Only paths on the current disk are allowed.
6887

69-
By default, the listing file gets the same base name as the source file. You can change the name of the listing file and the directory where it is created using the **/Fa** option.
88+
*directory*\\*filename*
89+
A listing file named *filename*.asm is placed in the specified *directory*. This is only valid when compiling a single source code file.
7090

71-
|/Fa usage|Result|
72-
|----------------|------------|
73-
|**/Fa**|One *source_file*.asm is created for each source code file in the compilation.|
74-
|**/Fa** *filename*|*filename*.asm is placed in the current directory. Only valid when compiling a single source code file.|
75-
|**/Fa** *filename.extension*|*filename.extension* is placed in the current directory. Only valid when compiling a single source code file.|
76-
|**/Fa** *directory*\|One *source_file*.asm is created and placed in the specified *directory* for each source code file in the compilation. Note the required trailing backslash. Only paths on the current disk are allowed.|
77-
|**/Fa** *directory*\\*filename*|*filename*.asm is placed in the specified `directory`. Only valid when compiling a single source code file.|
78-
|**/Fa** *directory*\\*filename.extension*|*filename.extension* is placed in the specified `directory`. Only valid when compiling a single source code file.|
91+
*directory*\\*filename.extension*
92+
A listing file named *filename.extension* is placed in the specified *directory*. This is only valid when compiling a single source code file.
7993

8094
### To set this compiler option in the Visual Studio development environment
8195

82-
1. Open the project's **Property Pages** dialog box. For details, see [Setting Visual C++ Project Properties](../../ide/working-with-project-properties.md).
96+
1. Open the project's **Property Pages** dialog box. For details, see [Working with Project Properties](../../ide/working-with-project-properties.md).
8397

84-
2. Click the **C/C++** folder.
98+
2. Open the **C/C++** folder and select the **Output Files** property page.
8599

86-
3. Click the **Output Files** property page.
100+
3. Modify the **Assembler Output** property to set the `/FAc` and `/FAs` options for assembler, machine, and source code. Modify the **Use Unicode For Assembler Listing** property to set the `/FAu` option for ANSI or UTF-8 output. Modify the **ASM List Location** to set the `/Fa` option for listing file name and location.
87101

88-
4. Modify the **ASM List Location** (**/Fa**) or **Assembler Output** (**/FA**) property (**/FAu** must be specified in the **Command Line** property page, **Additional Options** box..
102+
Note that setting both **Assembler Output** and **Use Unicode For Assembler Listing** properties can cause [Command-Line Warning D9025](../../error-messages/tool-errors/command-line-warning-d9025.md). To combine these options in the IDE, use the **Additional Options** field in the **Command Line** property page instead.
89103

90104
### To set this compiler option programmatically
91105

92-
- See <xref:Microsoft.VisualStudio.VCProjectEngine.VCCLCompilerTool.AssemblerListingLocation%2A> or <xref:Microsoft.VisualStudio.VCProjectEngine.VCCLCompilerTool.AssemblerOutput%2A>. To specify **/FAu**, see <xref:Microsoft.VisualStudio.VCProjectEngine.VCCLCompilerTool.AdditionalOptions%2A>.
106+
- See <xref:Microsoft.VisualStudio.VCProjectEngine.VCCLCompilerTool.AssemblerListingLocation%2A> or <xref:Microsoft.VisualStudio.VCProjectEngine.VCCLCompilerTool.AssemblerOutput%2A>. To specify `/FAu`, see <xref:Microsoft.VisualStudio.VCProjectEngine.VCCLCompilerTool.AdditionalOptions%2A>.
93107

94108
## Example
95-
The following command line produces a combined source and machine-code listing called HELLO.cod:
109+
The following command line produces a combined source and machine-code listing called HELLO.cod:
96110

97111
```
98112
CL /FAcs HELLO.CPP

docs/build/reference/zc-conformance.md

Lines changed: 23 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -38,26 +38,35 @@ translation.priority.ht:
3838
- "zh-tw"
3939
---
4040
# /Zc (Conformance)
41-
You can use the **/Zc** compiler option to specify standard or Microsoft-specific compiler behavior. Here are the **/Zc** compiler options:
41+
You can use the **/Zc** compiler options to specify standard or Microsoft-specific compiler behavior.
4242

43-
- [/Zc:forScope](../../build/reference/zc-forscope-force-conformance-in-for-loop-scope.md)
43+
## Syntax
4444

45-
- [/Zc:wchar_t](../../build/reference/zc-wchar-t-wchar-t-is-native-type.md)
45+
`/Zc:`_option_{,_option_}
4646

47-
- [/Zc:auto](../../build/reference/zc-auto-deduce-variable-type.md)
47+
## Remarks
4848

49-
- [/Zc:trigraphs](../../build/reference/zc-trigraphs-trigraphs-substitution.md)
49+
When Visual Studio has implemented an extension to C or C++ that is not compatible with the standard, you can use a `/Zc` conformance option to specify standard-conforming or Microsoft-specific behavior. For some options, the Microsoft-specific behavior is the default, to prevent large-scale breaking changes to existing code. In other cases, the default is the standard behavior, where improvements in security, performance, or compatibility outweigh the costs of breaking changes. The default setting of each conformance option may change in newer versions of Visual Studio. For more information about each conformance option, see the topic for the specific option.
5050

51-
- [/Zc:rvalueCast](../../build/reference/zc-rvaluecast-enforce-type-conversion-rules.md)
51+
These are the `/Zc` compiler options:
5252

53-
- [/Zc:strictStrings](../../build/reference/zc-strictstrings-disable-string-literal-type-conversion.md)
53+
|Option|Behavior|
54+
|---|---|
55+
|[auto\[-\]](zc-auto-deduce-variable-type.md)|Enforce the new Standard C++ meaning for `auto` (on by default).|
56+
|[forScope\[-\]](zc-forscope-force-conformance-in-for-loop-scope.md)|Enforce Standard C++ `for` scoping rules (on by default).|
57+
|[implicitNoexcept\[-\]](zc-implicitnoexcept-implicit-exception-specifiers.md)|Enable implicit `noexcept` on required functions (on by default).|
58+
|[inline\[-\]](zc-inline-remove-unreferenced-comdat.md)|Remove unreferenced function or data if it is COMDAT or has internal linkage only (off by default).|
59+
|[referenceBinding\[-\]](zc-referencebinding-enforce-reference-binding-rules.md)|A UDT temporary will not bind to an non-const lvalue reference (off by default).|
60+
|[rvalueCast\[-\]](zc-rvaluecast-enforce-type-conversion-rules.md)|Enforce Standard C++ explicit type conversion rules (on by default).|
61+
|[sizedDealloc\[-\]](zc-sizeddealloc-enable-global-sized-dealloc-functions.md)|Enable C++14 global sized deallocation functions (on by default).|
62+
|[strictStrings\[-\]](zc-strictstrings-disable-string-literal-type-conversion.md)|Disable string-literal to `char*` or `wchar_t*` conversion (off by default).|
63+
|[threadSafeInit\[-\]](zc-threadsafeinit-thread-safe-local-static-initialization.md)|Enable thread-safe local static initialization (on by default).|
64+
|[throwingNew\[-\]](zc-throwingnew-assume-operator-new-throws.md)|Assume `operator new` throws on failure (off by default).|
65+
|[trigraphs\[-\]](zc-trigraphs-trigraphs-substitution.md)|Enable trigraphs (obsolete, off by default).|
66+
|[wchar_t\[-\]](zc-wchar-t-wchar-t-is-native-type.md)|`wchar_t` is a native type, not a typedef (on by default).|
5467

55-
- [/Zc:inline](../../build/reference/zc-inline-remove-unreferenced-comdat.md)
56-
57-
- [/Zc:implicitNoexcept](../../build/reference/zc-implicitnoexcept-implicit-exception-specifiers.md)
58-
59-
For more information about conformance issues in Visual C++, see [Nonstandard Behavior](../../cpp/nonstandard-behavior.md).
68+
For more information about conformance issues in Visual C++, see [Nonstandard Behavior](../../cpp/nonstandard-behavior.md).
6069

6170
## See Also
62-
[Compiler Options](../../build/reference/compiler-options.md)
63-
[Setting Compiler Options](../../build/reference/setting-compiler-options.md)
71+
[Compiler Options](compiler-options.md)
72+
[Setting Compiler Options](setting-compiler-options.md)
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
---
2+
title: "/Zc:referenceBinding (Enforce reference binding rules) | Microsoft Docs"
3+
ms.custom: ""
4+
ms.date: "12/13/2016"
5+
ms.reviewer: ""
6+
ms.suite: ""
7+
ms.technology:
8+
- "devlang-cpp"
9+
ms.tgt_pltfrm: ""
10+
ms.topic: "article"
11+
f1_keywords:
12+
- "referenceBinding"
13+
- "/Zc:referenceBinding"
14+
dev_langs:
15+
- "C++"
16+
helpviewer_keywords:
17+
- "-Zc compiler options (C++)"
18+
- "referenceBinding"
19+
- "Enforce reference binding rules"
20+
- "/Zc compiler options (C++)"
21+
- "Zc compiler options (C++)"
22+
ms.assetid: 0c6cfaac-9c2a-41a3-aa94-64ca8ef261fc
23+
caps.latest.revision: 1
24+
author: "corob-msft"
25+
ms.author: "corob"
26+
manager: "ghogen"
27+
translation.priority.ht:
28+
- "cs-cz"
29+
- "de-de"
30+
- "es-es"
31+
- "fr-fr"
32+
- "it-it"
33+
- "ja-jp"
34+
- "ko-kr"
35+
- "pl-pl"
36+
- "pt-br"
37+
- "ru-ru"
38+
- "tr-tr"
39+
- "zh-cn"
40+
- "zh-tw"
41+
---
42+
# /Zc:referenceBinding (Enforce reference binding rules)
43+
When the **/Zc:referenceBinding** option is specified, the compiler does not allow a non-const lvalue reference to bind to a temporary.
44+
45+
## Syntax
46+
47+
```
48+
/Zc:referenceBinding[-]
49+
```
50+
51+
## Remarks
52+
If **/Zc:referenceBinding** is specified, the compiler follows section 8.5.3 of the C++11 standard and does not allow expressions that bind a user-defined type temporary to a non-const lvalue reference. By default, or if **/Zc:referenceBinding-** is specified, the compiler allows such expressions as a Microsoft extension, but a level 4 warning is issued. For code security, portability and conformance, we recommend that you use **/Zc:referenceBinding**. The [/permissive-](permissive-standards-conformance.md) compiler option implicitly sets this option, but it can be overridden by using **/Zc:referenceBinding-**.
53+
54+
## Example
55+
56+
This sample shows the Microsoft extension that allows a temporary of a user-defined type to be bound to a non-const lvalue reference.
57+
```cpp
58+
// zcreferencebinding.cpp
59+
struct S {
60+
};
61+
62+
void f(S&) {
63+
}
64+
65+
S g() {
66+
return S{};
67+
}
68+
69+
void main() {
70+
S& s = g(); // warning C4239 at /W4
71+
const S& cs = g(); // okay, bound to const ref
72+
f(g()); // Extension: error C2664 only if /Zc:referenceBinding
73+
}
74+
```
75+
76+
For more information about conformance issues in Visual C++, see [Nonstandard Behavior](../../cpp/nonstandard-behavior.md).
77+
78+
### To set this compiler option in the Visual Studio development environment
79+
80+
1. Open the project's **Property Pages** dialog box. For details, see [Working with Project Properties](../../ide/working-with-project-properties.md).
81+
82+
2. Select the **C/C++** folder.
83+
84+
3. Select the **Command Line** property page.
85+
86+
4. Modify the **Additional Options** property to include **/Zc:referenceBinding** and then choose **OK**.
87+
88+
## See Also
89+
[Compiler Options](../../build/reference/compiler-options.md)
90+
[Setting Compiler Options](../../build/reference/setting-compiler-options.md)
91+
[/Zc (Conformance)](../../build/reference/zc-conformance.md)
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
---
2+
title: "/Zc:sizedDealloc (Enable Global Sized Deallocation Functions) | Microsoft Docs"
3+
ms.custom: ""
4+
ms.date: "12/13/2016"
5+
ms.reviewer: ""
6+
ms.suite: ""
7+
ms.technology:
8+
- "devlang-cpp"
9+
ms.tgt_pltfrm: ""
10+
ms.topic: "article"
11+
f1_keywords:
12+
- "sizedDealloc"
13+
- "/Zc:sizedDealloc"
14+
dev_langs:
15+
- "C++"
16+
helpviewer_keywords:
17+
- "-Zc compiler options (C++)"
18+
- "sizedDealloc"
19+
- "Enable Global Sized Deallocation Functions"
20+
- "/Zc compiler options (C++)"
21+
- "Zc compiler options (C++)"
22+
ms.assetid: 3a73ace0-4d36-420a-b699-0ca6fc0dd134
23+
caps.latest.revision: 1
24+
author: "corob-msft"
25+
ms.author: "corob"
26+
manager: "ghogen"
27+
translation.priority.ht:
28+
- "cs-cz"
29+
- "de-de"
30+
- "es-es"
31+
- "fr-fr"
32+
- "it-it"
33+
- "ja-jp"
34+
- "ko-kr"
35+
- "pl-pl"
36+
- "pt-br"
37+
- "ru-ru"
38+
- "tr-tr"
39+
- "zh-cn"
40+
- "zh-tw"
41+
---
42+
# /Zc:sizedDealloc (Enable Global Sized Deallocation Functions)
43+
The `/Zc:sizedDealloc` compiler option tells the compiler to preferentially call global `operator delete` or `operator delete[]` functions that have a second parameter of type `size_t` when the size of the object is available. These functions may use the `size_t` parameter to optimize deallocator performance.
44+
45+
## Syntax
46+
`/Zc:sizedDealloc`[`-`\]
47+
48+
## Remarks
49+
50+
In the C++11 standard, you may define static member functions `operator delete` and `operator delete[]` that take a second, `size_t` parameter. Typically these are used in combination with [operator new](../../cpp/new-operator-cpp.md) functions to implement more efficient allocators and deallocators for the object. However, C++11 did not define an equivalent set of deallocation functions at global scope. In C++11, global deallocation functions that have a second parameter of type `size_t` are considered placement delete functions. They must be explicitly called by passing a size argument.
51+
52+
The C++14 standard changes the behavior of the compiler. When you define global `operator delete` and `operator delete[]` that take a second parameter of type `size_t`, the compiler prefers to call these functions when member scope versions are not invoked and the size of the object is available. The compiler passes the size argument implicitly. The single argument versions are called when the compiler can't determine the size of the object being deallocated. Otherwise, the usual rules for choosing the version of the deallocation function to invoke still apply. Calls to the global functions may be explicitly specified by prepending the scope resolution operator (`::`) to the deallocation function call.
53+
54+
By default, Visual C++ starting in Visual Studio 2015 implements this C++14 standard behavior. You may explicitly specify this by setting the `/Zc:sizedDealloc` compiler option. This represents a potentially breaking change. Use the `/Zc:sizedDealloc-` option to preserve the old behavior, for example, when your code defines placement delete operators that use a second parameter of type `size_t`. The default Visual Studio library implementations of the global deallocation functions that have the second parameter of type `size_t` invoke the single parameter versions. If your code supplies only single-parameter global operator delete and operator delete[], the default library implementations of the global sized deallocation functions invoke your global functions.
55+
56+
For more information about conformance issues in Visual C++, see [Nonstandard Behavior](../../cpp/nonstandard-behavior.md).
57+
58+
## To set this compiler option in the Visual Studio development environment
59+
1. Open the project's **Property Pages** dialog box. For details, see [Working with Project Properties](../../ide/working-with-project-properties.md).
60+
2. From the **Configurations** drop down menu, choose **All Configurations**.
61+
3. Select the **Configuration Properties**, **C/C++**, **Command Line** property page.
62+
4. Modify the **Additional Options** property to include `/Zc:sizedDealloc` or `/Zc:sizedDealloc-` and then choose **OK**.
63+
64+
## See Also
65+
[Compiler Options](../../build/reference/compiler-options.md)
66+
[Setting Compiler Options](../../build/reference/setting-compiler-options.md)
67+
[/Zc (Conformance)](../../build/reference/zc-conformance.md)

0 commit comments

Comments
 (0)