Skip to content

Commit 0fe4576

Browse files
TaojunshenSteve Wishnouskyrachana-sataoopbld15Colin Robertson
authored
4/19/2022 AM Publish (MicrosoftDocs#4233)
* Update open-wopen.md Clarify that _O_TEMPORARY sets FILE_SHARE_DELETE. * Update other pages that mention _O_TEMPORARY effects. * New article - IDL method wizard * update after review * update after review * Update after review * Update after review * Updating - Add property wizard for VS2022 * Updating broken links * Update after review * New article - Add an IDL Property * link updation * Update after review * update after review * update after review * New article - IDL MFC property wizard * Broken link fixed * Broken link fixed * Update virtual-functions.md * update for links * Updating links * Address cpp-docs 3780 3782 3790 3791 3805 * Attempt correction of table format * Add documentation for compiler error C2956 and update error text (MicrosoftDocs#4176) * Add documentation for compiler error C2956 and update error text * Add TOC entry * Update for grammar and my own comprehension. Sometimes, you just get carried away. This version could use some simplification. * Simplify. Address remarks, attempt simplification. Acrolinx all the things. * More updates per review Co-authored-by: Colin Robertson <corob@microsoft.com> * Address cpp-docs 3816 * Address non-blocking issues from 4207 * fix for sample program. * edits * edit pass. Move to ide location * minor edit * fix link * Final update * final update * final update * resolving blocking issue * resolving blocking issue * ToC update for new article * ToC update * link update * Correct inconsistent formatting for the `_O_EXCL` constant in the docs for the open functions * Update c28195.md * Update in alt-text * Update in alt-text * Final Update- See also section * edit pass * edit pass * more cleanup * typo * small edit * Final update * edit pass * edit pass * formatting for scannability * acrolinx * one more try at spacing * final update * VMCS -> VMXON According to the intel IA32 development manual (Volume 3 C3 23.7): "Before executing VMXON, software should allocate a naturally aligned 4-KByte region of memory that a logical processor may use to support VMX operation. This region is called the VMXON region." * edit and add links * fix links * add code example * click->tick * Update date, link to Intel docs * Another go at updating the description * Fix stray double-quote * Address issue in DD PR 1393452 * add /interface and /internal-partition - draft (MicrosoftDocs#4227) * add /interface and /internal-partition - draft * add example * fix formatting * update text regarding example * tech review * link updates * fix switch name and link * edits * reorder version info * cleanup * add /tp flag * fix command line Co-authored-by: TylerMSFT <Tyler.Whitney@microsoft.com> * Update os-ot-favor-small-code-favor-fast-code.md Change "minimize or maximize size" to "minimize size or maximize speed" * Expand into a whole SEO-friendly sentence * Clarify when _matherr will be invoked (#4230) Customer here https://developercommunity.visualstudio.com/t/_matherr-example-does-not-work-for-me/1676341#T-ND10016474 expressed confusion over when _matherr is called. This change points out that the only setting that will enable/disable this is the presence of _matherr, but it will not be triggered when using intrinsics. * acrolinx and other fixes * fix typo * more code escape * another code escape * better formatting for retval possibilities * fix backslashes * incorp feedback Co-authored-by: Steve Wishnousky <stwish@microsoft.com> Co-authored-by: rachana-satao <83084319+rachana-satao@users.noreply.github.com> Co-authored-by: opbld15 <opbld15@microsoft.com> Co-authored-by: Colin Robertson <corob@microsoft.com> Co-authored-by: opbld16 <opbld16@microsoft.com> Co-authored-by: opbld17 <opbld17@microsoft.com> Co-authored-by: atikmapari <31974726+atikmapari@users.noreply.github.com> Co-authored-by: PRMerger19 <prmrgr19@microsoft.com> Co-authored-by: Ming Ho <94572161+homing1@users.noreply.github.com> Co-authored-by: PRMerger5 <prmergr5@microsoft.com> Co-authored-by: Regan Downer <97987445+v-regandowner@users.noreply.github.com> Co-authored-by: Jonathan Emmett <joemmett@microsoft.com> Co-authored-by: Tamara K <93546702+tamarakhader@users.noreply.github.com> Co-authored-by: TylerMSFT <Tyler.Whitney@microsoft.com> Co-authored-by: PRMerger17 <prmrgr17@microsoft.com> Co-authored-by: Paula Miller <v-paulmi@microsoft.com> Co-authored-by: Martin Storsjö <martin@martin.st> Co-authored-by: Sunny Chatterjee <sunnych@microsoft.com> Co-authored-by: Tyler Whitney <TylerMSFT@users.noreply.github.com> Co-authored-by: Colin Cooper <72402153+v-ccolin@users.noreply.github.com> Co-authored-by: krispy <monstertyo@gmail.com> Co-authored-by: PRMerger8 <prmrgr8@microsoft.com> Co-authored-by: PRMerger10 <prmrgr10@microsoft.com> Co-authored-by: Tech Stuff <103606018+teknixstuff@users.noreply.github.com> Co-authored-by: Dennis Rea <v-denrea@microsoft.com>
1 parent 2cce586 commit 0fe4576

File tree

3 files changed

+45
-46
lines changed

3 files changed

+45
-46
lines changed

docs/build/reference/internal-partition.md

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,33 @@
11
---
22
title: "/internalPartition"
33
description: "Use the /internalPartition compiler option to treat the input file as an internal partition unit."
4-
ms.date: 04/15/2022
4+
ms.date: 04/18/2022
55
author: "tylermsft"
66
ms.author: "twhitney"
77
f1_keywords: ["/internalPartition", "VC.Project.VCCLCompilerTool.Interface"]
88
helpviewer_keywords: ["/internalPartition", "Translate include directives into import directives"]
99
---
1010
# `/internalPartition`
1111

12-
Use this switch to treat the input file on the command line as an [internal partition unit](http://eel.is/c%2B%2Bdraft/module#unit-4.3).
12+
Use the **`/internalPartition`** compiler option to treat the input file as an *internal partition unit*, which is a [module partition implementation unit](../../cpp/modules-cpp.md#implementing-modules) that doesn't contribute to the external interface of the module.
1313

1414
## Syntax
1515

1616
> **`/internalPartition`** *`filename`*
1717
1818
## Remarks
1919

20-
The following example demonstrates using the `/internalPartition` switch:
21-
22-
`m-internals.cpp`:
20+
The following example demonstrates how to use the `/internalPartition` option:
2321

2422
```cpp
23+
// m-internals.cpp
2524
module m:internals;
2625

2726
void internalFunc() {} // cannot have `export` since this is an internal partition
2827
```
2928

30-
`m.ixx`:
31-
3229
```cpp
30+
// m.ixx
3331
export module m;
3432
import :internals; // Cannot export this partition.
3533

@@ -43,7 +41,7 @@ To compile this interface:
4341
cl /std:c++latest /internalPartition /c m-internals.cpp
4442
```
4543

46-
This switch can't be used with the [`/interface`](interface.md) compiler switch.
44+
This option can't be used with the [`/interface`](interface.md) compiler option.
4745

4846
**`/internalPartition`** is available in Visual Studio 2019 version 16.10, or later.\
4947
**`/internalPartition`** requires [/std:c++20](std-specify-language-standard-version.md) or later.

docs/build/reference/os-ot-favor-small-code-favor-fast-code.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
---
22
title: "/Os, /Ot (Favor Small Code, Favor Fast Code)"
33
description: "The MSVC compiler options /Os and /Ot specify whether to favor size or speed when optimizing code."
4-
ms.date: 07/08/2020
4+
ms.date: 04/18/2022
55
f1_keywords: ["VC.Project.VCCLWCECompilerTool.FavorSizeOrSpeed", "/os", "VC.Project.VCCLCompilerTool.FavorSizeOrSpeed"]
66
helpviewer_keywords: ["favor fast code compiler option [C++]", "/Os compiler option [C++]", "Ot compiler option [C++]", "/Ot compiler option [C++]", "small machine code", "-Ot compiler option [C++]", "fast code", "favor small code compiler option [C++]", "Os compiler option [C++]", "-Os compiler option [C++]"]
77
ms.assetid: 9a340806-fa15-4308-892c-355d83cac0f2
88
---
99
# `/Os`, `/Ot` (Favor Small Code, Favor Fast Code)
1010

11-
Minimizes or maximizes the size of EXEs and DLLs.
11+
The **`/Os`** and **`/Ot`** compiler options specify whether to favor size (**`/Os`**) or speed (**`/Ot`**) when optimizing code.
1212

1313
## Syntax
1414

Lines changed: 37 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,44 @@
11
---
22
description: "Learn more about: _matherr"
33
title: "_matherr"
4-
ms.date: "04/05/2018"
4+
ms.date: "04/18/2012"
55
api_name: ["_matherr"]
66
api_location: ["msvcrt.dll", "msvcr80.dll", "msvcr90.dll", "msvcr100.dll", "msvcr100_clr0400.dll", "msvcr110.dll", "msvcr110_clr0400.dll", "msvcr120.dll", "msvcr120_clr0400.dll", "ucrtbase.dll"]
77
api_type: ["DLLExport"]
88
topic_type: ["apiref"]
99
f1_keywords: ["_matherr", "matherr"]
1010
helpviewer_keywords: ["_matherr function", "matherr function"]
11-
ms.assetid: b600d66e-165a-4608-a856-8fb418d46760
1211
---
13-
# _matherr
12+
# `_matherr`
1413

1514
Handles math errors.
1615

1716
## Syntax
1817

1918
```C
20-
int _matherr( struct _exception * except );
19+
int _matherr(struct _exception *except);
2120
```
2221
2322
### Parameters
2423
25-
*except*<br/>
24+
*`except`*\
2625
Pointer to the structure containing error information.
2726
2827
## Return Value
2928
30-
**_matherr** returns 0 to indicate an error, or a nonzero value to indicate success. If **_matherr** returns 0, an error message can be displayed and **errno** is set to an appropriate error value. If **_matherr** returns a nonzero value, no error message is displayed and **errno** remains unchanged.
29+
**`_matherr`** returns 0 to indicate an error, or a nonzero value to indicate success:
30+
- If **`_matherr`** returns 0, an error message can be displayed and **`errno`** is set to an appropriate error value.
31+
- If **`_matherr`** returns a nonzero value, no error message is displayed and **`errno`** remains unchanged.
3132
32-
For more information about return codes, see [_doserrno, errno, _sys_errlist, and _sys_nerr](../../c-runtime-library/errno-doserrno-sys-errlist-and-sys-nerr.md).
33+
For more information about return codes, see [`_doserrno`, `errno`, `_sys_errlist`, and `_sys_nerr`](../../c-runtime-library/errno-doserrno-sys-errlist-and-sys-nerr.md).
3334
3435
## Remarks
3536
36-
The **_matherr** function processes errors generated by the floating-point functions of the math library. These functions call **_matherr** when an error is detected.
37+
The **`_matherr`** function processes errors generated by the floating-point functions of the math library. These functions call **`_matherr`** when an error is detected. This interaction isn't impacted by the [floating-point mode of the compiler](../../build/reference/fp-specify-floating-point-behavior.md) or the [floating point control word](../../c-runtime-library/reference/control87-controlfp-control87-2.md). Since **`_matherr`** is a library function, math [intrinsic functions](../../intrinsics/compiler-intrinsics.md) won't call it.
3738
38-
For special error handling, you can provide a different definition of **_matherr**. If you use the dynamically linked version of the C run-time library (CRT), you can replace the default **_matherr** routine in a client executable with a user-defined version. However, you cannot replace the default **_matherr** routine in a DLL client of the CRT DLL.
39+
For special error handling, you can provide a different definition of **`_matherr`**. If you use the dynamically linked version of the C run-time library (CRT), you can replace the default **`_matherr`** routine in a client executable with a user-defined version. However, you can't replace the default **`_matherr`** routine in a DLL client of the CRT DLL.
3940
40-
When an error occurs in a math routine, **_matherr** is called with a pointer to an **_exception** type structure (defined in \<math.h>) as an argument. The **_exception** structure contains the following elements.
41+
When an error occurs in a math routine, **`_matherr`** is called with a pointer to an **`_exception`** type structure (defined in `<math.h>`) as an argument. The **`_exception`** structure contains the following elements.
4142
4243
```C
4344
struct _exception
@@ -50,36 +51,36 @@ struct _exception
5051
};
5152
```
5253

53-
The **type** member specifies the type of math error. It is one of the following values, defined in \<math.h>:
54+
The **`type`** member specifies the type of math error. It's one of the following values, defined in `<math.h>`:
5455

5556
|Macro|Meaning|
5657
|-|-|
57-
| **_DOMAIN** | Argument domain error |
58-
| **_SING** | Argument singularity |
59-
| **_OVERFLOW** | Overflow range error |
60-
| **_PLOSS** | Partial loss of significance |
61-
| **_TLOSS** | Total loss of significance |
62-
| **_UNDERFLOW** | The result is too small to be represented. (This condition is not currently supported.) |
58+
| **`_DOMAIN`** | Argument domain error |
59+
| **`_SING`** | Argument singularity |
60+
| **`_OVERFLOW`** | Overflow range error |
61+
| **`_PLOSS`** | Partial loss of significance |
62+
| **`_TLOSS`** | Total loss of significance |
63+
| **`_UNDERFLOW`** | The result is too small to be represented. (This condition isn't currently supported.) |
6364

64-
The structure member **name** is a pointer to a null-terminated string containing the name of the function that caused the error. The structure members **arg1** and **arg2** specify the values that caused the error. If only one argument is given, it is stored in **arg1**.
65+
The structure member **`name`** is a pointer to a null-terminated string containing the name of the function that caused the error. The structure members **`arg1`** and **`arg2`** specify the values that caused the error. If only one argument is given, it's stored in **`arg1`**.
6566

66-
The default return value for the given error is **retval**. If you change the return value, it must specify whether an error actually occurred.
67+
The default return value for the given error is **`retval`**. If you change the return value, it must specify whether an error actually occurred.
6768

6869
## Requirements
6970

7071
|Routine|Required header|
7172
|-------------|---------------------|
72-
|**_matherr**|\<math.h>|
73+
|**`_matherr`**|`<math.h>`|
7374

7475
For more compatibility information, see [Compatibility](../../c-runtime-library/compatibility.md).
7576

7677
## Example
7778

7879
```C
79-
// crt_matherr.c
80-
/* illustrates writing an error routine for math
81-
* functions. The error function must be:
82-
* _matherr
80+
/* crt_matherr.c
81+
* Illustrates writing an error routine for math
82+
* functions.
83+
* The error handling function must be named _matherr
8384
*/
8485

8586
#include <math.h>
@@ -102,27 +103,27 @@ int main()
102103
* returns the natural or base-10 logarithm of the absolute value
103104
* of the argument and suppresses the usual error message.
104105
*/
105-
int _matherr( struct _exception *except )
106+
int _matherr(struct _exception *except)
106107
{
107108
/* Handle _DOMAIN errors for log or log10. */
108-
if( except->type == _DOMAIN )
109+
if (except->type == _DOMAIN)
109110
{
110-
if( strcmp( except->name, "log" ) == 0 )
111+
if (strcmp(except->name, "log") == 0)
111112
{
112-
except->retval = log( -(except->arg1) );
113-
printf( "Special: using absolute value: %s: _DOMAIN "
114-
"error\n", except->name );
113+
except->retval = log(-(except->arg1));
114+
printf("Special: using absolute value: %s: _DOMAIN "
115+
"error\n", except->name);
115116
return 1;
116117
}
117-
else if( strcmp( except->name, "log10" ) == 0 )
118+
else if (strcmp(except->name, "log10") == 0)
118119
{
119-
except->retval = log10( -(except->arg1) );
120-
printf( "Special: using absolute value: %s: _DOMAIN "
121-
"error\n", except->name );
120+
except->retval = log10(-(except->arg1));
121+
printf("Special: using absolute value: %s: _DOMAIN "
122+
"error\n", except->name);
122123
return 1;
123124
}
124125
}
125-
printf( "Normal: " );
126+
printf("Normal: ");
126127
return 0; /* Else use the default actions */
127128
}
128129
```
@@ -137,4 +138,4 @@ Normal: log( 0.0 ) = -inf
137138

138139
## See also
139140

140-
[Floating-Point Support](../../c-runtime-library/floating-point-support.md)<br/>
141+
[Floating-Point Support](../../c-runtime-library/floating-point-support.md)

0 commit comments

Comments
 (0)