From 0fe4576e891cd7cb91babbb7d8c2df24c18009af Mon Sep 17 00:00:00 2001 From: Taojunshen Date: Wed, 20 Apr 2022 01:21:40 +0800 Subject: [PATCH] 4/19/2022 AM Publish (#4233) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 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 (#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 * 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 (#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 * 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 Co-authored-by: rachana-satao <83084319+rachana-satao@users.noreply.github.com> Co-authored-by: opbld15 Co-authored-by: Colin Robertson Co-authored-by: opbld16 Co-authored-by: opbld17 Co-authored-by: atikmapari <31974726+atikmapari@users.noreply.github.com> Co-authored-by: PRMerger19 Co-authored-by: Ming Ho <94572161+homing1@users.noreply.github.com> Co-authored-by: PRMerger5 Co-authored-by: Regan Downer <97987445+v-regandowner@users.noreply.github.com> Co-authored-by: Jonathan Emmett Co-authored-by: Tamara K <93546702+tamarakhader@users.noreply.github.com> Co-authored-by: TylerMSFT Co-authored-by: PRMerger17 Co-authored-by: Paula Miller Co-authored-by: Martin Storsjö Co-authored-by: Sunny Chatterjee Co-authored-by: Tyler Whitney Co-authored-by: Colin Cooper <72402153+v-ccolin@users.noreply.github.com> Co-authored-by: krispy Co-authored-by: PRMerger8 Co-authored-by: PRMerger10 Co-authored-by: Tech Stuff <103606018+teknixstuff@users.noreply.github.com> Co-authored-by: Dennis Rea --- docs/build/reference/internal-partition.md | 14 ++-- .../os-ot-favor-small-code-favor-fast-code.md | 4 +- docs/c-runtime-library/reference/matherr.md | 73 ++++++++++--------- 3 files changed, 45 insertions(+), 46 deletions(-) diff --git a/docs/build/reference/internal-partition.md b/docs/build/reference/internal-partition.md index 047e89c76cf..889ba738911 100644 --- a/docs/build/reference/internal-partition.md +++ b/docs/build/reference/internal-partition.md @@ -1,7 +1,7 @@ --- title: "/internalPartition" description: "Use the /internalPartition compiler option to treat the input file as an internal partition unit." -ms.date: 04/15/2022 +ms.date: 04/18/2022 author: "tylermsft" ms.author: "twhitney" f1_keywords: ["/internalPartition", "VC.Project.VCCLCompilerTool.Interface"] @@ -9,7 +9,7 @@ helpviewer_keywords: ["/internalPartition", "Translate include directives into i --- # `/internalPartition` -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). +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. ## Syntax @@ -17,19 +17,17 @@ Use this switch to treat the input file on the command line as an [internal part ## Remarks -The following example demonstrates using the `/internalPartition` switch: - -`m-internals.cpp`: +The following example demonstrates how to use the `/internalPartition` option: ```cpp +// m-internals.cpp module m:internals; void internalFunc() {} // cannot have `export` since this is an internal partition ``` -`m.ixx`: - ```cpp +// m.ixx export module m; import :internals; // Cannot export this partition. @@ -43,7 +41,7 @@ To compile this interface: cl /std:c++latest /internalPartition /c m-internals.cpp ``` -This switch can't be used with the [`/interface`](interface.md) compiler switch. +This option can't be used with the [`/interface`](interface.md) compiler option. **`/internalPartition`** is available in Visual Studio 2019 version 16.10, or later.\ **`/internalPartition`** requires [/std:c++20](std-specify-language-standard-version.md) or later. diff --git a/docs/build/reference/os-ot-favor-small-code-favor-fast-code.md b/docs/build/reference/os-ot-favor-small-code-favor-fast-code.md index 7d66878bd71..9325d110121 100644 --- a/docs/build/reference/os-ot-favor-small-code-favor-fast-code.md +++ b/docs/build/reference/os-ot-favor-small-code-favor-fast-code.md @@ -1,14 +1,14 @@ --- title: "/Os, /Ot (Favor Small Code, Favor Fast Code)" description: "The MSVC compiler options /Os and /Ot specify whether to favor size or speed when optimizing code." -ms.date: 07/08/2020 +ms.date: 04/18/2022 f1_keywords: ["VC.Project.VCCLWCECompilerTool.FavorSizeOrSpeed", "/os", "VC.Project.VCCLCompilerTool.FavorSizeOrSpeed"] 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++]"] ms.assetid: 9a340806-fa15-4308-892c-355d83cac0f2 --- # `/Os`, `/Ot` (Favor Small Code, Favor Fast Code) -Minimizes or maximizes the size of EXEs and DLLs. +The **`/Os`** and **`/Ot`** compiler options specify whether to favor size (**`/Os`**) or speed (**`/Ot`**) when optimizing code. ## Syntax diff --git a/docs/c-runtime-library/reference/matherr.md b/docs/c-runtime-library/reference/matherr.md index 45cbb55ca03..a3d52e22885 100644 --- a/docs/c-runtime-library/reference/matherr.md +++ b/docs/c-runtime-library/reference/matherr.md @@ -1,43 +1,44 @@ --- description: "Learn more about: _matherr" title: "_matherr" -ms.date: "04/05/2018" +ms.date: "04/18/2012" api_name: ["_matherr"] 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"] api_type: ["DLLExport"] topic_type: ["apiref"] f1_keywords: ["_matherr", "matherr"] helpviewer_keywords: ["_matherr function", "matherr function"] -ms.assetid: b600d66e-165a-4608-a856-8fb418d46760 --- -# _matherr +# `_matherr` Handles math errors. ## Syntax ```C -int _matherr( struct _exception * except ); +int _matherr(struct _exception *except); ``` ### Parameters -*except*
+*`except`*\ Pointer to the structure containing error information. ## Return Value -**_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. +**`_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. -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). +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). ## Remarks -The **_matherr** function processes errors generated by the floating-point functions of the math library. These functions call **_matherr** when an error is detected. +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. -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. +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. -When an error occurs in a math routine, **_matherr** is called with a pointer to an **_exception** type structure (defined in \) as an argument. The **_exception** structure contains the following elements. +When an error occurs in a math routine, **`_matherr`** is called with a pointer to an **`_exception`** type structure (defined in ``) as an argument. The **`_exception`** structure contains the following elements. ```C struct _exception @@ -50,36 +51,36 @@ struct _exception }; ``` -The **type** member specifies the type of math error. It is one of the following values, defined in \: +The **`type`** member specifies the type of math error. It's one of the following values, defined in ``: |Macro|Meaning| |-|-| -| **_DOMAIN** | Argument domain error | -| **_SING** | Argument singularity | -| **_OVERFLOW** | Overflow range error | -| **_PLOSS** | Partial loss of significance | -| **_TLOSS** | Total loss of significance | -| **_UNDERFLOW** | The result is too small to be represented. (This condition is not currently supported.) | +| **`_DOMAIN`** | Argument domain error | +| **`_SING`** | Argument singularity | +| **`_OVERFLOW`** | Overflow range error | +| **`_PLOSS`** | Partial loss of significance | +| **`_TLOSS`** | Total loss of significance | +| **`_UNDERFLOW`** | The result is too small to be represented. (This condition isn't currently supported.) | -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**. +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`**. -The default return value for the given error is **retval**. If you change the return value, it must specify whether an error actually occurred. +The default return value for the given error is **`retval`**. If you change the return value, it must specify whether an error actually occurred. ## Requirements |Routine|Required header| |-------------|---------------------| -|**_matherr**|\| +|**`_matherr`**|``| For more compatibility information, see [Compatibility](../../c-runtime-library/compatibility.md). ## Example ```C -// crt_matherr.c -/* illustrates writing an error routine for math -* functions. The error function must be: -* _matherr +/* crt_matherr.c +* Illustrates writing an error routine for math +* functions. +* The error handling function must be named _matherr */ #include @@ -102,27 +103,27 @@ int main() * returns the natural or base-10 logarithm of the absolute value * of the argument and suppresses the usual error message. */ -int _matherr( struct _exception *except ) +int _matherr(struct _exception *except) { /* Handle _DOMAIN errors for log or log10. */ - if( except->type == _DOMAIN ) + if (except->type == _DOMAIN) { - if( strcmp( except->name, "log" ) == 0 ) + if (strcmp(except->name, "log") == 0) { - except->retval = log( -(except->arg1) ); - printf( "Special: using absolute value: %s: _DOMAIN " - "error\n", except->name ); + except->retval = log(-(except->arg1)); + printf("Special: using absolute value: %s: _DOMAIN " + "error\n", except->name); return 1; } - else if( strcmp( except->name, "log10" ) == 0 ) + else if (strcmp(except->name, "log10") == 0) { - except->retval = log10( -(except->arg1) ); - printf( "Special: using absolute value: %s: _DOMAIN " - "error\n", except->name ); + except->retval = log10(-(except->arg1)); + printf("Special: using absolute value: %s: _DOMAIN " + "error\n", except->name); return 1; } } - printf( "Normal: " ); + printf("Normal: "); return 0; /* Else use the default actions */ } ``` @@ -137,4 +138,4 @@ Normal: log( 0.0 ) = -inf ## See also -[Floating-Point Support](../../c-runtime-library/floating-point-support.md)
+[Floating-Point Support](../../c-runtime-library/floating-point-support.md)