Skip to content

Commit a3af459

Browse files
Tyler WhitneyTyler Whitney
authored andcommitted
Merge branch 'master' of https://github.com/MicrosoftDocs/cpp-docs-pr into twhitney-ofuncs
2 parents c229690 + 632d778 commit a3af459

File tree

7 files changed

+63
-62
lines changed

7 files changed

+63
-62
lines changed

docs/build/configure-cmake-debugging-sessions.md

Lines changed: 34 additions & 33 deletions
Large diffs are not rendered by default.

docs/c-runtime-library/link-options.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: "Link Options"
33
ms.date: "11/04/2016"
4-
helpviewer_keywords: ["nothrownew.obj", "newmode.obj", "noenv.obj", "psetargv.obj", "loosefpmath.obj", "smallheap.obj", "fp10.obj", "nochkclr.obj", "chkstk.obj", "pcommode.obj", "pnoenv.obj", "link options [C++]", "invalidcontinue.obj", "pnothrownew.obj", "pwsetargv.obj", "pinvalidcontinue.obj", "wsetargv.obj", "binmode.obj", "setargv.obj", "noarg.obj", "pnewmode.obj", "commode.obj", "pthreadlocale.obj", "pbinmode.obj", "threadlocale.obj", "pnoarg.obj"]
4+
helpviewer_keywords: ["nothrownew.obj", "newmode.obj", "noenv.obj", "psetargv.obj", "legacy_stdio_float_rounding.obj", "loosefpmath.obj", "smallheap.obj", "fp10.obj", "nochkclr.obj", "chkstk.obj", "pcommode.obj", "pnoenv.obj", "link options [C++]", "invalidcontinue.obj", "pnothrownew.obj", "pwsetargv.obj", "pinvalidcontinue.obj", "wsetargv.obj", "binmode.obj", "setargv.obj", "noarg.obj", "pnewmode.obj", "commode.obj", "pthreadlocale.obj", "pbinmode.obj", "threadlocale.obj", "pnoarg.obj"]
55
ms.assetid: 05b5a77b-9dd1-494b-ae46-314598c770bb
66
---
77
# Link Options
@@ -18,6 +18,7 @@ CLR pure mode versions of these objects are deprecated in Visual Studio 2015 and
1818
|exe_initialize_mta.lib|n/a|Initializes the MTA apartment during EXE startup, which allows the use of COM objects in global smart pointers. Because this option leaks an MTA apartment reference during shutdown, do not use it for DLLs. Linking to this is equivalent to including combase.h and defining _EXE_INITIALIZE_MTA. |
1919
|fp10.obj|n/a|Changes the default precision control to 64 bits. See [Floating-Point Support](../c-runtime-library/floating-point-support.md).|
2020
|invalidcontinue.obj|pinvalidcontinue.obj|Sets a default invalid parameter handler that does nothing, meaning that invalid parameters passed to CRT functions will just set errno and return an error result.|
21+
|legacy_stdio_float_rounding.obj|n/a|Printing floating-point values (for example, when using [printf](../c-runtime-library/reference/printf-printf-l-wprintf-wprintf-l.md)) with the Windows 10 19041 Universal C Runtime has been fixed. It now properly rounds exactly representable floating-point numbers, and respects the floating-point rounding requested by [fesetenv](../c-runtime-library/reference/fesetenv1.md). This behavior update is available in Visual Studio 2019 version 16.2 and later. Legacy behavior is used in earlier versions of Visual Studio, or by providing this link option.|
2122
|loosefpmath.obj|n/a|Ensures that floating point code tolerates denormal values.|
2223
|newmode.obj|pnewmode.obj|Causes [malloc](../c-runtime-library/reference/malloc.md) to call the new handler on failure. See [_set_new_mode](../c-runtime-library/reference/set-new-mode.md), [_set_new_handler](../c-runtime-library/reference/set-new-handler.md), [calloc](../c-runtime-library/reference/calloc.md), and [realloc](../c-runtime-library/reference/realloc.md).|
2324
|noarg.obj|pnoarg.obj|Disables all processing of argc and argv.|

docs/c-runtime-library/standard-types.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ The Microsoft run-time library defines the following standard types and typedefs
5555
|`jmp_buf` array|Used by [setjmp](../c-runtime-library/reference/setjmp.md) and [longjmp](../c-runtime-library/reference/longjmp.md) to save and restore program environment.|SETJMP.H|
5656
|`lconv` structure|Contains formatting rules for numeric values in different countries/regions. Used by [localeconv](../c-runtime-library/reference/localeconv.md).|LOCALE.H|
5757
|`_LDOUBLE`,<br /><br /> `_LONGDOUBLE`,<br /><br /> `_LDBL12` (long double or an unsigned char array)|Use to represent a long double value.|STDLIB.H|
58-
|`_locale_t` structure|Stores current locale values; used in all locale specific C run-time libraries.|CRTDEF.H|
58+
|`_locale_t` structure|Stores current locale values; used in all locale specific C run-time libraries.|CRTDEFS.H|
5959
|`mbstate_t`|Tracks the state of a multibyte character conversion.|WCHAR.H|
6060
|`off_t`, `_off_t` long integer|Represents file-offset value.|WCHAR.H, SYS\TYPES.H|
6161
|`_onexit_t`,<br /><br /> `_onexit_m_t` pointer|Returned by [_onexit, _onexit_m](../c-runtime-library/reference/onexit-onexit-m.md).|STDLIB.H|

docs/cpp/raw-pointers.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,8 @@ int main()
272272

273273
// use operator new to allocate untyped memory block
274274
void* pvoid = operator new(1000);
275-
for(char* c = static_cast<char*>(pvoid); pvoid < &pvoid + 1000; ++c)
275+
char* pchar = static_cast<char*>(pvoid);
276+
for(char* c = pchar; c < pchar + 1000; ++c)
276277
{
277278
*c = 0x00;
278279
}

docs/cpp/try-except-statement.md

Lines changed: 21 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
---
2-
title: "try-except Statement"
3-
ms.date: "10/09/2018"
2+
title: "try-except statement"
3+
description: "The Microsoft C++ reference to the __try and __except structured exception handling statements."
4+
ms.date: "04/03/2020"
45
f1_keywords: ["_abnormal_termination_cpp", "_exception_code_cpp", "_exception_info", "__except", "_except", "_exception_code", "__except_cpp", "_exception_info_cpp"]
56
helpviewer_keywords: ["__try keyword [C++]", "EXCEPTION_CONTINUE_EXECUTION macro", "EXCEPTION_CONTINUE_SEARCH macro", "EXCEPTION_EXECUTE_HANDLER macro", "GetExceptionCode function", "try-catch keyword [C++], try-except keyword [C++]", "_exception_code keyword [C++]", "try-except keyword [C++]", "_exception_info keyword [C++]", "_abnormal_termination keyword [C++]"]
67
ms.assetid: 30d60071-ea49-4bfb-a8e6-7a420de66381
78
---
8-
# try-except Statement
9+
# try-except statement
910

10-
**Microsoft Specific**
11-
12-
The **try-except** statement is a Microsoft extension to the C and C++ languages that supports structured exception handling.
11+
The **try-except** statement is a Microsoft extension that supports structured exception handling in the C and C++ languages. This extension is **Microsoft-specific**.
1312

1413
## Syntax
1514

@@ -24,50 +23,50 @@ The **try-except** statement is a Microsoft extension to the C and C++ languages
2423
2524
## Remarks
2625

27-
The **try-except** statement is a Microsoft extension to the C and C++ languages that enables target applications to gain control when events that normally terminate program execution occur. Such events are called *exceptions*, and the mechanism that deals with exceptions is called *structured exception handling* (SEH).
26+
The **try-except** statement is a Microsoft extension to the C and C++ languages. It enables target applications to gain control when events occur that normally terminate program execution. Such events are called *structured exceptions*, or *exceptions* for short. The mechanism that deals with these exceptions is called *structured exception handling* (SEH).
2827

2928
For related information, see the [try-finally statement](../cpp/try-finally-statement.md).
3029

31-
Exceptions can be either hardware-based or software-based. Even when applications cannot completely recover from hardware or software exceptions, structured exception handling makes it possible to display error information and trap the internal state of the application to help diagnose the problem. This is especially useful for intermittent problems that cannot be reproduced easily.
30+
Exceptions may be either hardware-based or software-based. Structured exception handling is useful even when applications can't completely recover from hardware or software exceptions. SEH makes it possible to display error information and trap the internal state of the application to help diagnose the problem. It's especially useful for intermittent problems that aren't easy to reproduce.
3231

3332
> [!NOTE]
34-
> Structured exception handling works with Win32 for both C and C++ source files. However, it is not specifically designed for C++. You can ensure that your code is more portable by using C++ exception handling. Also, C++ exception handling is more flexible, in that it can handle exceptions of any type. For C++ programs, it is recommended that you use the C++ exception-handling mechanism ([try, catch, and throw](../cpp/try-throw-and-catch-statements-cpp.md) statements).
33+
> Structured exception handling works with Win32 for both C and C++ source files. However, it's not specifically designed for C++. You can ensure that your code is more portable by using C++ exception handling. Also, C++ exception handling is more flexible, in that it can handle exceptions of any type. For C++ programs, we recommend you use native C++ exception-handling: [try, catch, and throw](../cpp/try-throw-and-catch-statements-cpp.md) statements.
3534
36-
The compound statement after the **__try** clause is the body or guarded section. The compound statement after the **__except** clause is the exception handler. The handler specifies a set of actions to be taken if an exception is raised during execution of the body of the guarded section. Execution proceeds as follows:
35+
The compound statement after the **__try** clause is the *body* or *guarded* section. The **__except** expression is also known as the *filter* expression. Its value determines how the exception is handled. The compound statement after the **__except** clause is the exception handler. The handler specifies the actions to take if an exception is raised during execution of the body section. Execution proceeds as follows:
3736

3837
1. The guarded section is executed.
3938

4039
1. If no exception occurs during execution of the guarded section, execution continues at the statement after the **__except** clause.
4140

42-
1. If an exception occurs during execution of the guarded section or in any routine the guarded section calls, the **__except** *expression* (called the *filter* expression) is evaluated and the value determines how the exception is handled. There are three possible values:
41+
1. If an exception occurs during execution of the guarded section, or in any routine the guarded section calls, the **__except** expression is evaluated. There are three possible values:
4342

44-
- EXCEPTION_CONTINUE_EXECUTION (-1) Exception is dismissed. Continue execution at the point where the exception occurred.
43+
- `EXCEPTION_CONTINUE_EXECUTION` (-1) Exception is dismissed. Continue execution at the point where the exception occurred.
4544

46-
- EXCEPTION_CONTINUE_SEARCH (0) Exception is not recognized. Continue to search up the stack for a handler, first for containing **try-except** statements, then for handlers with the next highest precedence.
45+
- `EXCEPTION_CONTINUE_SEARCH` (0) Exception isn't recognized. Continue to search up the stack for a handler, first for containing **try-except** statements, then for handlers with the next highest precedence.
4746

48-
- EXCEPTION_EXECUTE_HANDLER (1) Exception is recognized. Transfer control to the exception handler by executing the **__except** compound statement, then continue execution after the **__except** block.
47+
- `EXCEPTION_EXECUTE_HANDLER` (1) Exception is recognized. Transfer control to the exception handler by executing the **__except** compound statement, then continue execution after the **__except** block.
4948

50-
Because the **__except** expression is evaluated as a C expression, it is limited to a single value, the conditional-expression operator, or the comma operator. If more extensive processing is required, the expression can call a routine that returns one of the three values listed above.
49+
The **__except** expression is evaluated as a C expression. It's limited to a single value, the conditional-expression operator, or the comma operator. If more extensive processing is required, the expression can call a routine that returns one of the three values listed above.
5150

5251
Each application can have its own exception handler.
5352

54-
It is not valid to jump into a **__try** statement, but valid to jump out of one. The exception handler is not called if a process is terminated in the middle of executing a **try-except** statement.
53+
It's not valid to jump into a **__try** statement, but valid to jump out of one. The exception handler isn't called if a process is terminated in the middle of executing a **try-except** statement.
5554

5655
For compatibility with previous versions, **_try**, **_except**, and **_leave** are synonyms for **__try**, **__except**, and **__leave** unless compiler option [/Za \(Disable language extensions)](../build/reference/za-ze-disable-language-extensions.md) is specified.
5756

5857
### The __leave Keyword
5958

6059
The **__leave** keyword is valid only within the guarded section of a **try-except** statement, and its effect is to jump to the end of the guarded section. Execution continues at the first statement after the exception handler.
6160

62-
A **goto** statement can also jump out of the guarded section, and it does not degrade performance as it does in a **try-finally** statement because stack unwinding does not occur. However, we recommend that you use the **__leave** keyword rather than a **goto** statement because you are less likely to make a programming mistake if the guarded section is large or complex.
61+
A **goto** statement can also jump out of the guarded section, and it doesn't degrade performance as it does in a **try-finally** statement. That's because stack unwinding doesn't occur. However, we recommend that you use the **__leave** keyword rather than a **goto** statement. The reason is because you're less likely to make a programming mistake if the guarded section is large or complex.
6362

6463
### Structured Exception Handling Intrinsic Functions
6564

66-
Structured exception handling provides two intrinsic functions that are available to use with the **try-except** statement: `GetExceptionCode` and `GetExceptionInformation`.
65+
Structured exception handling provides two intrinsic functions that are available to use with the **try-except** statement: [GetExceptionCode](/windows/win32/Debug/getexceptioncode) and [GetExceptionInformation](/windows/win32/Debug/getexceptioninformation).
6766

6867
`GetExceptionCode` returns the code (a 32-bit integer) of the exception.
6968

70-
The intrinsic function `GetExceptionInformation` returns a pointer to a structure containing additional information about the exception. Through this pointer, you can access the machine state that existed at the time of a hardware exception. The structure is as follows:
69+
The intrinsic function `GetExceptionInformation` returns a pointer to an [EXCEPTION_POINTERS](/windows/win32/api/winnt/ns-winnt-exception_pointers) structure containing additional information about the exception. Through this pointer, you can access the machine state that existed at the time of a hardware exception. The structure is as follows:
7170

7271
```cpp
7372
typedef struct _EXCEPTION_POINTERS {
@@ -78,11 +77,11 @@ typedef struct _EXCEPTION_POINTERS {
7877
7978
The pointer types `PEXCEPTION_RECORD` and `PCONTEXT` are defined in the include file \<winnt.h>, and `_EXCEPTION_RECORD` and `_CONTEXT` are defined in the include file \<excpt.h>
8079
81-
You can use `GetExceptionCode` within the exception handler. However, you can use `GetExceptionInformation` only within the exception filter expression. The information it points to is generally on the stack and is no longer available when control is transferred to the exception handler.
80+
You can use `GetExceptionCode` within the exception handler. However, you can use `GetExceptionInformation` only within the exception filter expression. The information it points to is generally on the stack and is no longer available when control gets transferred to the exception handler.
8281
83-
The intrinsic function `AbnormalTermination` is available within a termination handler. It returns 0 if the body of the **try-finally** statement terminates sequentially. In all other cases, it returns 1.
82+
The intrinsic function [AbnormalTermination](/windows/win32/Debug/abnormaltermination) is available within a termination handler. It returns 0 if the body of the **try-finally** statement terminates sequentially. In all other cases, it returns 1.
8483
85-
excpt.h defines some alternate names for these intrinsics:
84+
\<excpt.h> defines some alternate names for these intrinsics:
8685
8786
`GetExceptionCode` is equivalent to `_exception_code`
8887
@@ -154,8 +153,6 @@ in except
154153
world
155154
```
156155

157-
**END Microsoft Specific**
158-
159156
## See also
160157

161158
[Writing an exception handler](../cpp/writing-an-exception-handler.md)<br/>

docs/cppcx/wrl/module-class.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ Name | Description
8585
### Macros
8686
8787
Name | Description
88-
-------------------------------------------------- ------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
88+
---------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
8989
[ActivatableClass](activatableclass-macros.md) | Populates an internal cache that contains a factory that can create an instance of the specified class. This macro specifies default factory and group ID parameters.
9090
[ActivatableClassWithFactory](activatableclass-macros.md) | Populates an internal cache that contains a factory that can create an instance of the specified class. This macro enables you to specify a particular factory parameter.
9191
[ActivatableClassWithFactoryEx](activatableclass-macros.md) | Populates an internal cache that contains a factory that can create an instance of the specified class. This macro enables you to specify particular factory and group ID parameters.

docs/standard-library/list-class.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1589,7 +1589,8 @@ After deleting the element at the beginning of the list, the first element is: 2
15891589
Adds an element to the end of a list.
15901590

15911591
```cpp
1592-
void push_back(void push_back(Type&& val);
1592+
void push_back(const Type& val);
1593+
void push_back(Type&& val);
15931594
```
15941595
15951596
### Parameters

0 commit comments

Comments
 (0)