Skip to content

Commit 7f3df9f

Browse files
authored
Merge pull request #1266 from MicrosoftDocs/master
8/21 AM Publish
2 parents 9be4b66 + 90c7812 commit 7f3df9f

21 files changed

+482
-277
lines changed

.openpublishing.redirection.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,11 @@
235235
"redirect_url": "/cpp/cpp/program-and-linkage-cpp",
236236
"redirect_document_id": false
237237
},
238+
{
239+
"source_path": "docs/cpp/template-friends.md",
240+
"redirect_url": "/cpp/cpp/templates-cpp",
241+
"redirect_document_id": false
242+
},
238243
{
239244
"source_path": "docs/cpp/using-extern-to-specify-linkage.md",
240245
"redirect_url": "/cpp/cpp/extern-cpp",

docs/atl/reference/atl-text-encoding-functions.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ ms.date: "11/04/2016"
55
ms.topic: "reference"
66
f1_keywords: ["atlbase/ATL::AtlGetHexValue", "atlbase/ATL::AtlGetVersion", "atlenc/ATL::AtlHexDecode", "atlenc/ATL::AtlHexDecodeGetRequiredLength", "atlenc/ATL::AtlHexEncode", "atlenc/ATL::AtlHexEncodeGetRequiredLength", "atlenc/ATL::AtlHexValue", "atlenc/ATL::BEncode", "atlenc/ATL::BEncodeGetRequiredLength", "atlenc/ATL::EscapeXML", "atlenc/ATL::GetExtendedChars", "atlenc/ATL::IsExtendedChar", "atlenc/ATL::QEncode", "atlenc/ATL::QEncodeGetRequiredLength", "atlenc/ATL::QPDecode", "atlenc/ATL::QPDecodeGetRequiredLength", "atlenc/ATL::QPEncode", "atlenc/ATL::QPEncodeGetRequiredLength", "atlenc/ATL::UUDecode", "atlenc/ATL::UUDecodeGetRequiredLength", "atlenc/ATL::UUEncode", "atlenc/ATL::UUEncodeGetRequiredLength"]
77
ms.assetid: 2ae1648b-2b87-4112-92aa-0069fcfd23da
8+
author: "mikeblome"
9+
ms.author: "mblome"
10+
ms.workload: ["cplusplus"]
811
---
912
# ATL Text Encoding Functions
1013
These functions support text encoding and decoding.

docs/build/reference/TOC.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@
7878
#### [/hotpatch (Create Hotpatchable Image)](hotpatch-create-hotpatchable-image.md)
7979
#### [/I (Additional Include Directories)](i-additional-include-directories.md)
8080
#### [/J (Default char Type Is unsigned)](j-default-char-type-is-unsigned.md)
81+
#### [/JMC (Just My Code debugging)](jmc.md)
8182
#### [/kernel (Create Kernel Mode Binary)](kernel-create-kernel-mode-binary.md)
8283
#### [/link (Pass Options to Linker)](link-pass-options-to-linker.md)
8384
#### [/LN (Create MSIL Module)](ln-create-msil-module.md)
@@ -259,6 +260,7 @@
259260
### [/RELEASE (Set the Checksum)](release-set-the-checksum.md)
260261
### [/SAFESEH (Image has Safe Exception Handlers)](safeseh-image-has-safe-exception-handlers.md)
261262
### [/SECTION (Specify Section Attributes)](section-specify-section-attributes.md)
263+
### [/SOURCELINK (Include Sourcelink file in PDB)](sourcelink.md)
262264
### [/STACK (Stack Allocations)](stack-stack-allocations.md)
263265
### [/STUB (MS-DOS Stub File Name)](stub-ms-dos-stub-file-name.md)
264266
### [/SUBSYSTEM (Specify Subsystem)](subsystem-specify-subsystem.md)

docs/build/reference/compiler-options-listed-alphabetically.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: "Compiler Options Listed Alphabetically | Microsoft Docs"
33
ms.custom: ""
4-
ms.date: "02/22/2018"
4+
ms.date: "08/20/2018"
55
ms.technology: ["cpp-tools"]
66
ms.topic: "reference"
77
dev_langs: ["C++"]
@@ -79,6 +79,7 @@ The following is a comprehensive alphabetical list of compiler options. For a ca
7979
|[/hotpatch](hotpatch-create-hotpatchable-image.md)|Creates a hotpatchable image.|
8080
|[/I](i-additional-include-directories.md)|Searches a directory for include files.|
8181
|[/J](j-default-char-type-is-unsigned.md)|Changes the default `char` type.|
82+
|[/JMC](jmc.md)|Supports native C++ Just My Code debugging.|
8283
|[/kernel](kernel-create-kernel-mode-binary.md)|The compiler and linker will create a binary that can be executed in the Windows kernel.|
8384
|[/LD](md-mt-ld-use-run-time-library.md)|Creates a dynamic-link library.|
8485
|[/LDd](md-mt-ld-use-run-time-library.md)|Creates a debug dynamic-link library.|

docs/build/reference/compiler-options-listed-by-category.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: "Compiler Options Listed by Category | Microsoft Docs"
33
ms.custom: ""
4-
ms.date: "11/04/2016"
4+
ms.date: "08/20/2018"
55
ms.technology: ["cpp-tools"]
66
ms.topic: "reference"
77
dev_langs: ["C++"]
@@ -159,6 +159,7 @@ This article contains a categorical list of compiler options. For an alphabetica
159159
|[/H](h-restrict-length-of-external-names.md)|Deprecated. Restricts the length of external (public) names.|
160160
|[/HELP](help-compiler-command-line-help.md)|Lists the compiler options.|
161161
|[/J](j-default-char-type-is-unsigned.md)|Changes the default `char` type.|
162+
|[/JMC](jmc.md)|Supports native C++ Just My Code debugging.|
162163
|[/kernel](kernel-create-kernel-mode-binary.md)|The compiler and linker will create a binary that can be executed in the Windows kernel.|
163164
|[/MP](mp-build-with-multiple-processes.md)|Builds multiple source files concurrently.|
164165
|[/nologo](nologo-suppress-startup-banner-c-cpp.md)|Suppresses display of sign-on banner.|

docs/build/reference/exports.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: "EXPORTS | Microsoft Docs"
33
ms.custom: ""
4-
ms.date: "07/11/2018"
4+
ms.date: "08/20/2018"
55
ms.technology: ["cpp-tools"]
66
ms.topic: "reference"
77
f1_keywords: ["EXPORTS"]
@@ -38,13 +38,20 @@ EXPORTS
3838
func2=func1
3939
```
4040

41-
If the name that you export is from other module, specify the export's name in the DLL by using *other_module.exported_name*. For example, if your DLL exports a function `other_module.func1` and you want callers to use it as `func2`, you would specify:
41+
If the name that you export is from some other module, specify the export's name in the DLL by using *other_module.exported_name*. For example, if your DLL exports a function `other_module.func1` and you want callers to use it as `func2`, you would specify:
4242

4343
```DEF
4444
EXPORTS
4545
func2=other_module.func1
4646
```
4747

48+
If the name that you export is from another module that exports by ordinal, specify the export's ordinal in the DLL by using *other_module.#ordinal_number*. For example, if your DLL exports a function from the other module where it is ordinal 42, and you want callers to use it as `func2`, you would specify:
49+
50+
```DEF
51+
EXPORTS
52+
func2=other_module.#42
53+
```
54+
4855
Because the Visual C++ compiler uses name decoration for C++ functions, you must either use the decorated name internal_name or define the exported functions by using extern "C" in the source code. The compiler also decorates C functions that use the [__stdcall](../../cpp/stdcall.md) calling convention with an underscore (_) prefix and a suffix composed of the at sign (@) followed by the number of bytes (in decimal) in the argument list.
4956

5057
To find the decorated names produced by the compiler, use the [DUMPBIN](../../build/reference/dumpbin-reference.md) tool or the linker [/MAP](../../build/reference/map-generate-mapfile.md) option. The decorated names are compiler-specific. If you export the decorated names in the .DEF file, executables that link to the DLL must also be built by using the same version of the compiler. This ensures that the decorated names in the caller match the exported names in the .DEF file.

docs/build/reference/jmc.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
---
2+
title: "/JMC (Just My Code debugging) | Microsoft Docs"
3+
ms.custom: "08/20/2018"
4+
ms.technology: ["cpp-tools"]
5+
ms.topic: "reference"
6+
f1_keywords: ["/JMC"]
7+
dev_langs: ["C++"]
8+
helpviewer_keywords: ["/JMC compiler option [C++]", "Just my code [C++]", "-JMC compiler option [C++]", "User code, debugging", "JMC compiler option [C++]"]
9+
author: "corob-msft"
10+
ms.author: "corob"
11+
ms.workload: ["cplusplus"]
12+
---
13+
# /JMC (Just My Code debugging)
14+
15+
Specifies compiler support for native *Just My Code* debugging in the Visual Studio debugger. This option supports the user settings that allow Visual Studio to step over system, framework, library, and other non-user calls, and to collapse those calls in the call stack window. The **/JMC** compiler option is available starting in Visual Studio 2017 version 15.8.
16+
17+
## Syntax
18+
19+
> **/JMC**\[**-**]
20+
21+
## Remarks
22+
23+
The Visual Studio [Just My Code](/visualstudio/debugger/just-my-code) settings specify whether the Visual Studio debugger steps over system, framework, library, and other non-user calls. The **/JMC** compiler option enables support for Just My Code debugging in your native C++ code. When **/JMC** is enabled, the compiler inserts calls to a helper function, `__CheckForDebuggerJustMyCode`, in the function prolog. The helper function provides hooks that support Visual Studio debugger Just My Code step operations. To enable Just My Code in the Visual Studio debugger, on the menu bar, choose **Tools** > **Options**, and then set the option in **Debugging** > **General** > **Enable Just My Code**.
24+
25+
The **/JMC** option requires that your code links to the C Runtime Library (CRT), which provides the `__CheckForDebuggerJustMyCode` helper function. If your project does not link to the CRT, you may see linker error **LNK2019: unresolved external symbol __CheckForDebuggerJustMyCode**. To resolve this error, either link to the CRT, or disable the **/JMC** option.
26+
27+
By default, the **/JMC** compiler option is off. However, starting in Visual Studio 2017 version 15.8 this option is enabled in most Visual Studio project templates. To explicitly disable this option, use the **/JMC-** option on the command line. In Visual Studio, open the project Property Pages dialog box, and change the **Support Just My Code Debugging** property in the **Configuration Properties** > **C/C++** > **General** property page to **No**.
28+
29+
For more information, see [C++ Just My Code](/visualstudio/debugger/just-my-code#BKMK_C___Just_My_Code) in [Specify whether to debug only user code using Just My Code in Visual Studio](/visualstudio/debugger/just-my-code), and the Visual C++ Team Blog post [Announcing C++ Just My Code Stepping in Visual Studio](https://blogs.msdn.microsoft.com/vcblog/2018/06/29/announcing-jmc-stepping-in-visual-studio/).
30+
31+
### To set this compiler option in the Visual Studio development environment
32+
33+
1. Open the project's **Property Pages** dialog box. For details, see [Working with Project Properties](../../ide/working-with-project-properties.md).
34+
35+
1. Select the **Configuration Properties** > **C/C++** > **General** property page.
36+
37+
1. Modify the **Support Just My Code Debugging** property.
38+
39+
### To set this compiler option programmatically
40+
41+
- See <xref:Microsoft.VisualStudio.VCProjectEngine.VCCLCompilerTool.AdditionalOptions%2A>.
42+
43+
## See Also
44+
45+
[Compiler Options](../../build/reference/compiler-options.md)<br/>
46+
[Setting Compiler Options](../../build/reference/setting-compiler-options.md)<br/>

docs/build/reference/linker-options.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: "Linker Options | Microsoft Docs"
33
ms.custom: ""
4-
ms.date: "11/04/2016"
4+
ms.date: "08/20/2018"
55
ms.technology: ["cpp-tools"]
66
ms.topic: "reference"
77
f1_keywords: ["link"]
@@ -109,6 +109,7 @@ You can use the [comment](../../preprocessor/comment-c-cpp.md) pragma to specify
109109
|[/RELEASE](../../build/reference/release-set-the-checksum.md)|Sets the Checksum in the .exe header.|
110110
|[/SAFESEH](../../build/reference/safeseh-image-has-safe-exception-handlers.md)|Specifies that the image will contain a table of safe exception handlers.|
111111
|[/SECTION](../../build/reference/section-specify-section-attributes.md)|Overrides the attributes of a section.|
112+
|[/SOURCELINK](../../build/reference/sourcelink.md)|Specifies a SourceLink file to add to the PDB.|
112113
|[/STACK](../../build/reference/stack-stack-allocations.md)|Sets the size of the stack in bytes.|
113114
|[/STUB](../../build/reference/stub-ms-dos-stub-file-name.md)|Attaches an MS-DOS stub program to a Win32 program.|
114115
|[/SUBSYSTEM](../../build/reference/subsystem-specify-subsystem.md)|Tells the operating system how to run the .exe file.|

docs/build/reference/sourcelink.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
---
2+
title: "/SOURCELINK (Include Sourcelink file in PDB) | Microsoft Docs"
3+
ms.custom: ""
4+
ms.date: "08/20/2018"
5+
ms.technology: ["cpp-tools"]
6+
ms.topic: "reference"
7+
f1_keywords: ["/sourcelink"]
8+
dev_langs: ["C++"]
9+
helpviewer_keywords: ["/SOURCELINK linker option", "/SOURCELINK"]
10+
author: "corob-msft"
11+
ms.author: "corob"
12+
ms.workload: ["cplusplus"]
13+
---
14+
# /SOURCELINK (Include Sourcelink file in PDB)
15+
16+
Specifies a SourceLink configuration file to include in the PDB file generated by the linker.
17+
18+
## Syntax
19+
20+
> **/SOURCELINK:**_filename_
21+
22+
## Arguments
23+
24+
*filename*
25+
Specifies a JSON-formatted configuration file that contains a simple mapping of local file paths to URLs where the source file can be retrieved for display by the debugger. For more information on the format of this file, see [Source Link JSON Schema](https://github.com/dotnet/designs/blob/master/accepted/diagnostics/source-link.md#source-link-json-schema).
26+
27+
## Remarks
28+
29+
SourceLink is a language- and source-control agnostic system for providing source debugging for binaries. SourceLink is supported for native C++ binaries starting in Visual Studio 2017 version 15.8. For an overview of SourceLink, see [Source Link](https://github.com/dotnet/designs/blob/master/accepted/diagnostics/source-link.md). For information on how to use SourceLink in your projects and how to generate the SourceLink file as part of your project, see [Using SourceLink](https://github.com/dotnet/sourcelink#using-sourcelink).
30+
31+
### To set the /SOURCELINK linker option in Visual Studio
32+
33+
1. Open the **Property Pages** dialog box for the project. For more information, see [Working with Project Properties](../../ide/working-with-project-properties.md).
34+
35+
1. Select the **Configuration Properties** > **Linker** > **Command Line** property page.
36+
37+
1. In the **Additional options** box, add **/SOURCELINK:**_filename_ and then choose **OK** or **Apply** to save your changes.
38+
39+
### To set this linker option programmatically
40+
41+
- This option does not have a programmatic equivalent.
42+
43+
## See also
44+
45+
[Setting Linker Options](../../build/reference/setting-linker-options.md)
46+
[Linker Options](../../build/reference/linker-options.md)

docs/c-runtime-library/crt-library-features.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: "CRT Library Features | Microsoft Docs"
33
ms.custom: ""
4-
ms.date: "03/13/2018"
4+
ms.date: "08/20/2018"
55
ms.technology: ["cpp-standard-libraries"]
66
ms.topic: "conceptual"
77
f1_keywords: ["c.runtime"]
@@ -42,6 +42,9 @@ This table lists the libraries that implement the vcruntime library.
4242
|vcruntime.lib|vcruntime\<version>.dll|DLL import library for the vcruntime.|**/MD**|_MT, _DLL|
4343
|vcruntimed.lib|vcruntime\<version>d.dll|DLL import library for the Debug vcruntime. Not redistributable.|**/MDd**|_DEBUG, _MT, _DLL|
4444

45+
When the UCRT refactoring occurred, the Concurrency Runtime functions were moved into
46+
concrt140.dll, which is part of the C++ redistributable package. This DLL is required for C++ parallel containers and algorithms such as `concurrency::parallel_for`. In addition, the C++ Standard Library requires this DLL on Windows XP to support synchronization primitives, because Windows XP does not have condition variables.
47+
4548
The code that initializes the CRT is in one of several libraries, based on whether the CRT library is statically or dynamically linked, or native, managed, or mixed code. This code handles CRT startup, internal per-thread data initialization, and termination. It is specific to the version of the compiler used. This library is always statically linked, even when using a dynamically linked UCRT.
4649

4750
This table lists the libraries that implement CRT initialization and termination.

docs/cpp/TOC.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,6 @@
275275
## [Templates](templates-cpp.md)
276276
### [typename](typename.md)
277277
### [Class Templates](class-templates.md)
278-
### [Template Friends](template-friends.md)
279278
### [Function Templates](function-templates.md)
280279
#### [Function Template Instantiation](function-template-instantiation.md)
281280
#### [Explicit Instantiation](explicit-instantiation.md)

docs/cpp/attributes.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,11 @@ ms.custom: ""
44
ms.date: "03/28/2017"
55
ms.topic: "language-reference"
66
ms.assetid: 748340d9-8abf-4940-b0a0-91b6156a3ff8
7+
author: "mikeblome"
8+
ms.author: "mblome"
9+
ms.workload: ["cplusplus"]
710
---
11+
812
# Attributes in C++
913

1014
The C++ Standard defines a set of attributes and also allows compiler vendors to define their own attributes (within a vendor-specific namespace), but compilers are required to recognize only those attributes defined in the standard.

docs/cpp/goto-statement-cpp.md

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,25 @@ goto identifier;
2525
The labeled statement designated by `identifier` must be in the current function. All `identifier` names are members of an internal namespace and therefore do not interfere with other identifiers.
2626

2727
A statement label is meaningful only to a **goto** statement; otherwise, statement labels are ignored. Labels cannot be redeclared.
28+
29+
A **goto** statement is not allowed to transfer control to a location that skips over the initialization of any variable that is in scope in that location. The following example raises C2362:
30+
31+
```cpp
32+
int goto_fn(bool b)
33+
{
34+
if (!b)
35+
{
36+
goto exit; // C2362
37+
}
38+
else
39+
{ /*...*/ }
40+
41+
int error_code = 42;
42+
43+
exit:
44+
return error_code;
45+
}
46+
```
2847
2948
It is good programming style to use the **break**, **continue**, and **return** statements instead of the **goto** statement whenever possible. However, because the **break** statement exits from only one level of a loop, you might have to use a **goto** statement to exit a deeply nested loop.
3049
@@ -76,4 +95,4 @@ Jumped to stop. i = 3
7695

7796
## See also
7897
[Jump Statements](../cpp/jump-statements-cpp.md)
79-
[Keywords](../cpp/keywords-cpp.md)
98+
[Keywords](../cpp/keywords-cpp.md)
Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: "Microsoft-Specific Modifiers | Microsoft Docs"
33
ms.custom: ""
4-
ms.date: "11/04/2016"
4+
ms.date: "08/16/2018"
55
ms.technology: ["cpp-language"]
66
ms.topic: "language-reference"
77
dev_langs: ["C++"]
@@ -13,10 +13,29 @@ ms.workload: ["cplusplus"]
1313
# Microsoft-Specific Modifiers
1414
This section describes Microsoft-specific extensions to C++ in the following areas:
1515

16-
- [Based addressing](../cpp/based-addressing.md), the practice of using a pointer as a base from which other pointers can be offset
16+
- [Based addressing](based-addressing.md), the practice of using a pointer as a base from which other pointers can be offset
1717

18-
- [Function calling conventions](../cpp/calling-conventions.md)
18+
- [Function calling conventions](calling-conventions.md)
1919

20-
- Extended storage-class attributes declared with the [__declspec](../cpp/declspec.md) keyword
20+
- Extended storage-class attributes declared with the [__declspec](declspec.md) keyword
2121

22-
- The [__w64](../cpp/w64.md) keyword
22+
- The [__w64](w64.md) keyword
23+
24+
### Microsoft-Specific Keywords
25+
26+
Many of the Microsoft-specific keywords can be used to modify declarators to form derived types. For more information about declarators, see [Declarators](overview-of-declarators.md).
27+
28+
|Keyword|Meaning|Used to Form Derived Types?|
29+
|-------------|-------------|---------------------------------|
30+
|[__based](based-grammar.md)|The name that follows declares a 32-bit offset to the 32-bit base contained in the declaration.|Yes|
31+
|[__cdecl](cdecl.md)|The name that follows uses the C naming and calling conventions.|Yes|
32+
|[__declspec](declspec.md)|The name that follows specifies a Microsoft-specific storage-class attribute.|No|
33+
|[__fastcall](fastcall.md)|The name that follows declares a function that uses registers, when available, instead of the stack for argument passing.|Yes|
34+
|[__restrict](extension-restrict.md)|Similar to __declspec([restrict](restrict.md)), but for use on variables.|No|
35+
|[__stdcall](stdcall.md)|The name that follows specifies a function that observes the standard calling convention.|Yes|
36+
|[__w64](w64.md)|Marks a data type as being larger on a 64-bit compiler.|No|
37+
|[__unaligned](unaligned.md)|Specifies that a pointer to a type or other data is not aligned..|No|
38+
|[__vectorcall](vectorcall.md)|The name that follows declares a function that uses registers, including SSE registers, when available, instead of the stack for argument passing.|Yes|
39+
40+
## See Also
41+
[C++ Language Reference](cpp-language-reference.md)

docs/cpp/references-to-pointers.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: "References to Pointers | Microsoft Docs"
33
ms.custom: ""
4-
ms.date: "11/04/2016"
4+
ms.date: "08/20/2018"
55
ms.technology: ["cpp-language"]
66
ms.topic: "language-reference"
77
dev_langs: ["C++"]
@@ -66,7 +66,7 @@ int main( int argc, char *argv[] ) {
6666

6767
// Read a text file from the standard input device and
6868
// build a binary tree.
69-
//while( !cin.eof() )
69+
while( !cin.eof() )
7070
{
7171
cin.get( szBuf, sizeOfBuffer, '\n' );
7272
cin.get();

0 commit comments

Comments
 (0)