int main()
{
@@ -222,4 +222,4 @@ The main consideration for whether to use this approach is the balance between c
[Compare header units, modules, and precompiled headers](compare-inclusion-methods.md)\
[Tutorial: Import the C++ standard library using modules](../cpp/tutorial-import-stl-named-module.md)\
[Walkthrough: Build and import header units in your Visual C++ projects](walkthrough-header-units.md)\
-[`/translateInclude`](./reference/translateinclude.md)
\ No newline at end of file
+[`/translateInclude`](./reference/translateinclude.md)
diff --git a/docs/build/walkthrough-using-msbuild-to-create-a-visual-cpp-project.md b/docs/build/walkthrough-using-msbuild-to-create-a-visual-cpp-project.md
index 9543859eee..2e21028185 100644
--- a/docs/build/walkthrough-using-msbuild-to-create-a-visual-cpp-project.md
+++ b/docs/build/walkthrough-using-msbuild-to-create-a-visual-cpp-project.md
@@ -83,10 +83,10 @@ An MSBuild project file is an XML file that contains a project root element (`` element shown here. (Use `ToolsVersion="14.0"` if you're using Visual Studio 2015, `ToolsVersion="15.0"` if you're using Visual Studio 2017, or `ToolsVersion="16.0"` if you're using Visual Studio 2019.)
+1. Use a text editor to create a project file that is named *`myproject.vcxproj`*, and then add the root `` element shown here. (Use `ToolsVersion="14.0"` if you're using Visual Studio 2015, `ToolsVersion="15.0"` if you're using Visual Studio 2017, `ToolsVersion="16.0"` if you're using Visual Studio 2019, or `ToolsVersion="17.0"` if you're using Visual Studio 2022.)
```xml
-
+
```
@@ -113,12 +113,12 @@ An MSBuild project file is an XML file that contains a project root element (`
```
-1. Add a property group element (``) that specifies two project properties, `` and ``. (Use `v140` as the `` value if you're using Visual Studio 2015, `v141` if you're using Visual Studio 2017, or `v142` if you're using Visual Studio 2019.)
+1. Add a property group element (``) that specifies two project properties, `` and ``. (Use `v140` as the `` value if you're using Visual Studio 2015, `v141` if you're using Visual Studio 2017, `v142` if you're using Visual Studio 2019 or `v143` if you're using Visual Studio 2022.)
```xml
Application
- v142
+ v143
```
@@ -155,10 +155,10 @@ An MSBuild project file is an XML file that contains a project root element (`
+
Debug
diff --git a/docs/build/working-with-project-properties.md b/docs/build/working-with-project-properties.md
index 8cd9eae55a..7f6b508708 100644
--- a/docs/build/working-with-project-properties.md
+++ b/docs/build/working-with-project-properties.md
@@ -1,22 +1,23 @@
---
-title: "Set C++ compiler and build properties in Visual Studio"
+title: "Set C++ Compiler and Build Properties in Visual Studio"
description: "Use the Visual Studio IDE to change C++ compiler and linker options and other build settings."
-ms.date: "07/17/2019"
+ms.date: 03/19/2025
+ms.topic: concept-article
helpviewer_keywords: ["project properties [C++], modifying", "properties [C++]", "Visual C++ projects, properties", "projects [C++], properties"]
---
# Set compiler and build properties
-In the IDE, properties expose the information needed to build a project. This information includes the application name, extension (such as DLL, LIB, EXE), compiler options, linker options, debugger settings, custom build steps, and many other things. Typically, you use *property pages* to view and modify these properties. To access the property pages, choose **Project** > **_project-name_ Properties** from the main menu, or right-click on the project node in **Solution Explorer** and choose **Properties**.
+In the Visual Studio IDE, you can view and edit the properties needed to compile and build a project. This information includes the application name, extension (such as DLL, LIB, EXE), compiler options, linker options, debugger settings, and custom build steps.
+
+You can view and modify these properties by using *property pages*. To access the property pages, choose **Project** > **_project-name_ Properties** from the main menu, or right-click on the project node in **Solution Explorer** and choose **Properties**.
## Default properties
-When you create a project, the system assigns values for various properties. The defaults vary somewhat depending on the kind of project and what options you choose in the app wizard. For example, an ATL project has properties related to MIDL files, but these properties are absent in a basic console application. The default properties are shown in the General pane in the Property Pages:
+When you create a project, the system assigns values for various properties. The defaults vary somewhat depending on the kind of project and what options you choose in the app wizard. For example, an Active Template Library (ATL) project has properties related to Microsoft Interface Definition Language (MIDL) files, but these properties are absent in a basic console application. The default properties are shown in the Advanced pane in the **Property Pages** window:
-:::image type="complex" source="media/visual-c---project-defaults.png" alt-text="Screenshot of the Visual Studio project properties dialog.":::
-The General page is open. The Project Defaults section is highlighted, which includes Configuration Type set to Application (.exe), use of MFC set to Use standard Windows libraries, Character set is Unicode, Common Language Runtime Support is set to No Common Language Runtime Support, Whole Program optimization is set to No Whole Program Optimization, and Windows Store APP support is set to No.
-:::image-end:::
+:::image type="content" source="media/visual-c---project-defaults.png" alt-text="Screenshot of the Visual Studio project properties dialog box with the Advanced pane selected. Properties such as Use of MFC, Character Set, and so on are highlighted." lightbox="media/visual-c---project-defaults.png":::
-## Applying properties to build configurations and target platforms
+## Apply properties to build configurations and target platforms
Some properties, such as the application name, apply to all build variations and target platforms, whether it's a debug or release build. But most properties are configuration-dependent. To generate the correct code, the compiler has to know both the specific platform the program runs on and which specific compiler options to use. So when you set a property, it's important to pay attention to which configuration and platform the new value should apply to. Should it apply only to Debug Win32 builds, or should it also apply to Debug ARM64 and Debug x64? For example, the **Optimization** property, by default, is set to **Maximize Speed (/O2)** in a Release configuration, but is disabled in the Debug configuration.
@@ -28,11 +29,11 @@ The page is open to C/C++, Optimization. The Optimization setting is set to Disa
The following illustration shows the same project property page, but the configuration has been changed to Release. Note the different value for the Optimization property. Also note that the active configuration is still Debug. You can set properties for any configuration here; it doesn't have to be the active one.
-:::image type="content" source="media/visual-c---property-pages-showing-release-config.png" alt-text="Screenshot of the Visual Studio project Property Pages dialog. The Configuration dropdown is called out and is set to Release. The C/C++ > Optimization > Optimization setting is set to Maximize Speed (/O2).":::
+:::image type="content" source="media/visual-c---property-pages-showing-release-config.png" alt-text="Screenshot of the Visual Studio project Property Pages dialog. The Configuration dropdown is called out and is set to Release. The optimization setting is set to Maximize Speed slash O2.":::
## Target platforms
-*Target platform* refers to the kind of device and operating system that the executable will run on. You can build a project for more than one platform. The available target platforms for C++ projects depend on the kind of project. They include but aren't limited to Win32, x64, ARM, ARM64, Android, and iOS. The **x86** target platform that you might see in **Configuration Manager** is identical to **Win32** in native C++ projects. Win32 means 32-bit Windows and **x64** means 64-bit Windows. For more information about these two platforms, see [Running 32-bit applications](/windows/win32/WinProg64/running-32-bit-applications).
+*Target platform* refers to the kind of device and operating system that the executable runs on. You can build a project for more than one platform. The available target platforms for C++ projects depend on the kind of project. They include but aren't limited to Win32, x64, ARM, ARM64, Android, and iOS. The **x86** target platform that you might see in **Configuration Manager** is identical to **Win32** in native C++ projects. Win32 means 32-bit Windows and **x64** means 64-bit Windows. For more information about these two platforms, see [Running 32-bit applications](/windows/win32/WinProg64/running-32-bit-applications).
The **Any CPU** target platform value that you might see in **Configuration Manager** has no effect on native C++ projects. It's only relevant for C++/CLI and other .NET project types. For more information, see [`/CLRIMAGETYPE` (Specify Type of CLR Image)](reference/clrimagetype-specify-type-of-clr-image.md).
@@ -51,7 +52,7 @@ The **Property Pages** dialog box shows only the property pages that are relevan
## Directory and path values
-MSBuild supports the use of compile-time constants for certain string values, such as include directories and paths, called *macros*. A macro can refer to a value that's defined by Visual Studio or the MSBuild system, or to a user-defined value. Macros look like `$(macro-name)` or `%(item-macro-name)`. They're exposed in the property pages, where you can refer to and modify them by using the [Property Editor](#property_editor). Use macros instead of hard-coded values such as directory paths. Macros make it easier to share property settings between machines and between versions of Visual Studio. And, you can better ensure that your project settings participate correctly in [property inheritance](project-property-inheritance.md).
+MSBuild supports the use of compile-time constants for certain string values, such as include directories and paths, called *macros*. A macro can refer to a value that's defined by Visual Studio or the MSBuild system, or to a user-defined value. Macros look like `$(macro-name)` or `%(item-macro-name)`. They're exposed in the property pages, where you can refer to and modify them by using the [Property Editor](#property_editor). Use macros instead of hard-coded values such as directory paths. Macros make it easier to share property settings between machines and between versions of Visual Studio. You can also better ensure that your project settings participate correctly in [property inheritance](project-property-inheritance.md).
The following illustration shows the property pages for a Visual Studio C++ project. In the left pane, the **VC++ Directories** *rule* is selected, and the right pane lists the properties that are associated with that rule. The property values are often macros, such as `$(VC_SourcePath)`:
@@ -63,21 +64,21 @@ You can use the [Property Editor](#property_editor) to view the values of all av
### Predefined macros
-- **Global macros**:\
+- **Global macros**\
Global macros apply to all items in a project configuration. A global macro has the syntax `$(name)`. An example of a global macro is `$(VCInstallDir)`, which stores the root directory of your Visual Studio installation. A global macro corresponds to a `PropertyGroup` in MSBuild.
- **Item macros**\
- Item macros have the syntax `%(name)`. For a file, an item macro applies only to that file—for example, you can use `%(AdditionalIncludeDirectories)` to specify include directories that apply only to a particular file. This kind of item macro corresponds to an `ItemGroup` metadata in MSBuild. When used in the context of a project configuration, an item macro applies to all files of a certain type. For example, the C/C++ **Preprocessor Definitions** configuration property can take a `%(PreprocessorDefinitions)` item macro that applies to all .cpp files in the project. This kind of item macro corresponds to an `ItemDefinitionGroup` metadata in MSBuild. For more information, see [Item Definitions](/visualstudio/msbuild/item-definitions).
+ Item macros have the syntax `%(name)`. For a file, an item macro applies only to that file. For example, you can use `%(AdditionalIncludeDirectories)` to specify include directories that apply only to a particular file. This kind of item macro corresponds to an `ItemGroup` metadata in MSBuild. When used in the context of a project configuration, an item macro applies to all files of a certain type. For example, the C/C++ **Preprocessor Definitions** configuration property can take a `%(PreprocessorDefinitions)` item macro that applies to all .cpp files in the project. This kind of item macro corresponds to an `ItemDefinitionGroup` metadata in MSBuild. For more information, see [Item definitions](/visualstudio/msbuild/item-definitions).
### User-defined macros
-You can create *user-defined macros* to use as variables in project builds. For example, you could create a user-defined macro that provides a value to a custom build step or a custom build tool. A user-defined macro is a name/value pair. In a project file, use the `$(name)` notation to access the value.
+You can create *user-defined macros* to use as variables in project builds. For example, you could create a user-defined macro that provides a value to a custom build step or a custom build tool. A user-defined macro is a name-value pair. In a project file, use the `$(name)` notation to access the value.
A user-defined macro is stored in a property sheet. If your project doesn't already contain a property sheet, you can create one by following the steps under [Share or reuse Visual Studio project settings](create-reusable-property-configurations.md).
#### To create a user-defined macro
-1. Open the **Property Manager** window. (On the menu bar, choose **View** > **Property Manager** or **View** > **Other Windows** > **Property Manager**.) Open the shortcut menu for a property sheet (its name ends in *`.user`*) and then choose **Properties**. The **Property Pages** dialog box for that property sheet opens.
+1. Open the **Property Manager** window. On the menu bar, select **View** > **Other Windows** > **Property Manager**. Open the shortcut menu for a property sheet (its name ends in *`.user`*) and then choose **Properties**. The **Property Pages** dialog box for that property sheet opens.
1. In the left pane of the dialog box, select **User Macros**. In the right pane, choose the **Add Macro** button to open the **Add User Macro** dialog box.
@@ -99,20 +100,17 @@ The property editor for Include Directories is open. The evaluated value is disp
## Add an include directory to the set of default directories
-When you add an include directory to a project, it's important not to override all the default directories. The correct way to add a directory is to append the new path, for example "`C:\MyNewIncludeDir\`", and then to Append the **`$(IncludePath)`** macro to the property value.
+When you add an include directory to a project, it's important not to override all the default directories. The correct way to add a directory is to append the new path, for example `C:\MyNewIncludeDir\`, and then to append the `$(IncludePath)` macro to the property value.
## Quickly browse and search all properties
The **All Options** property page (under the **Configuration Properties** > **C/C++** node in the **Property Pages** dialog box) provides a quick way to browse and search the properties that are available in the current context. It has a special search box and a simple syntax to help you filter results:
-No prefix:\
-Search in property names only (case-insensitive substring).
+- No prefix: Search in property names only (case-insensitive substring).
-'`/`' or '`-`':\
-Search only in compiler switches (case-insensitive prefix)
+- '`/`' or '`-`': Search only in compiler switches (case-insensitive prefix).
-`v`:\
-Search only in values (case-insensitive substring).
+- `v`: Search only in values (case-insensitive substring).
## Set environment variables for a build
@@ -124,19 +122,14 @@ In the left pane of the project's **Property Pages** dialog box, expand **Config
In the right pane, modify the **Environment** or **Merge Environment** project settings and then choose the **OK** button.
-## In this section
-
-[Share or reuse Visual Studio project settings](create-reusable-property-configurations.md)\
-How to create a *`.props`* file with custom build settings that can be shared or reused.
-
-[Project property inheritance](project-property-inheritance.md)\
-Describes the order of evaluation for the *`.props`*, *`.targets`*, *`.vcxproj`* files, and environment variables in the build process.
+## Articles in this section
-[Modify properties and targets without changing the project file](modify-project-properties-without-changing-project-file.md)\
-How to create temporary build settings without having to modify a project file.
+- [Share or reuse Visual Studio project settings](create-reusable-property-configurations.md)
+- [Property inheritance in Visual Studio projects](project-property-inheritance.md)
+- [Modify C++ project properties and targets without changing the project file](modify-project-properties-without-changing-project-file.md)
## See also
-[Visual Studio Projects - C++](creating-and-managing-visual-cpp-projects.md)\
-[`.vcxproj` and `.props` file structure](reference/vcxproj-file-structure.md)\
-[Property page XML files](reference/property-page-xml-files.md)
+- [Visual Studio projects - C++](creating-and-managing-visual-cpp-projects.md)
+- [`.vcxproj` and `.props` file structure](reference/vcxproj-file-structure.md)
+- [Property Page XML rule files](reference/property-page-xml-files.md)
diff --git a/docs/build/x64-calling-convention.md b/docs/build/x64-calling-convention.md
index 54418166c4..abb153a846 100644
--- a/docs/build/x64-calling-convention.md
+++ b/docs/build/x64-calling-convention.md
@@ -1,21 +1,22 @@
---
-title: "x64 calling convention"
-description: "Learn about the details of the default x64 calling convention."
-ms.date: 05/17/2022
+title: "x64 Calling Convention"
+description: "Learn about the default x64 calling convention that one function uses to make calls into another function."
+ms.date: 03/19/2025
+ms.topic: concept-article
---
# x64 calling convention
-This section describes the standard processes and conventions that one function (the caller) uses to make calls into another function (the callee) in x64 code.
+This article describes the standard processes and conventions that one function (the caller) uses to make calls into another function (the callee) in x64 code.
-For more information on the `__vectorcall` calling convention, see [__vectorcall](../cpp/vectorcall.md).
+For more information about the `__vectorcall` calling convention, see [__vectorcall](../cpp/vectorcall.md).
## Calling convention defaults
-The x64 Application Binary Interface (ABI) uses a four-register fast-call calling convention by default. Space is allocated on the call stack as a shadow store for callees to save those registers.
+The x64 Application Binary Interface (ABI) uses a four-register, fast-call calling convention by default. Space is allocated on the call stack as a shadow store for callees to save those registers.
There's a strict one-to-one correspondence between a function call's arguments and the registers used for those arguments. Any argument that doesn't fit in 8 bytes, or isn't 1, 2, 4, or 8 bytes, must be passed by reference. A single argument is never spread across multiple registers.
-The x87 register stack is unused. It may be used by the callee, but consider it volatile across function calls. All floating point operations are done using the 16 XMM registers.
+The x87 register stack is unused. It might be used by the callee, but consider it volatile across function calls. All floating point operations are done using the 16 XMM registers.
Integer arguments are passed in registers RCX, RDX, R8, and R9. Floating point arguments are passed in XMM0L, XMM1L, XMM2L, and XMM3L. 16-byte arguments are passed by reference. Parameter passing is described in detail in [Parameter passing](#parameter-passing). These registers, and RAX, R10, R11, XMM4, and XMM5, are considered *volatile*, or potentially changed by a callee on return. Register usage is documented in detail in [x64 register usage](x64-software-conventions.md#x64-register-usage) and [Caller/callee saved registers](#callercallee-saved-registers).
@@ -27,13 +28,13 @@ Most structures are aligned to their natural alignment. The primary exceptions a
## Unwindability
-Leaf functions are functions that don't change any non-volatile registers. A non-leaf function may change non-volatile RSP, for example, by calling a function. Or, it could change RSP by allocating additional stack space for local variables. To recover non-volatile registers when an exception is handled, non-leaf functions are annotated with static data. The data describes how to properly unwind the function at an arbitrary instruction. This data is stored as *pdata*, or procedure data, which in turn refers to *xdata*, the exception handling data. The xdata contains the unwinding information, and can point to additional pdata or an exception handler function.
+Leaf functions are functions that don't change any nonvolatile registers. A nonleaf function might change nonvolatile RSP, for example, by calling a function. Or, it could change RSP by allocating more stack space for local variables. To recover nonvolatile registers when an exception is handled, nonleaf functions are annotated with static data. The data describes how to properly unwind the function at an arbitrary instruction. This data is stored as *pdata*, or procedure data, which in turn refers to *xdata*, the exception handling data. The xdata contains the unwinding information, and can point to additional pdata or an exception handler function.
Prologs and epilogs are highly restricted so that they can be properly described in xdata. The stack pointer must remain 16-byte aligned in any region of code that isn't part of an epilog or prolog, except within leaf functions. Leaf functions can be unwound simply by simulating a return, so pdata and xdata aren't required. For details about the proper structure of function prologs and epilogs, see [x64 prolog and epilog](../build/prolog-and-epilog.md). For more information about exception handling, and the exception handling and unwinding of pdata and xdata, see [x64 exception handling](../build/exception-handling-x64.md).
## Parameter passing
-By default, the x64 calling convention passes the first four arguments to a function in registers. The registers used for these arguments depend on the position and type of the argument. Remaining arguments get pushed on the stack in right-to-left order.
+By default, the x64 calling convention passes the first four arguments to a function in registers. The registers used for these arguments depend on the position and type of the argument. Remaining arguments get pushed on the stack in right-to-left order. All arguments passed on the stack are 8-byte aligned.
Integer valued arguments in the leftmost four positions are passed in left-to-right order in RCX, RDX, R8, and R9, respectively. The fifth and higher arguments are passed on the stack as previously described. All integer arguments in registers are right-justified, so the callee can ignore the upper bits of the register and access only the portion of the register necessary.
@@ -101,9 +102,9 @@ func2() { // RCX = 2, RDX = XMM1 = 1.0, and R8 = 7
## Return values
-A scalar return value that can fit into 64 bits, including the **`__m64`** type, is returned through RAX. Non-scalar types including floats, doubles, and vector types such as [`__m128`](../cpp/m128.md), [`__m128i`](../cpp/m128i.md), [`__m128d`](../cpp/m128d.md) are returned in XMM0. The state of unused bits in the value returned in RAX or XMM0 is undefined.
+A scalar return value that can fit into 64 bits, including the `__m64` type, is returned through RAX. Nonscalar types including floats, doubles, and vector types such as [`__m128`](../cpp/m128.md), [`__m128i`](../cpp/m128i.md), [`__m128d`](../cpp/m128d.md) are returned in XMM0. The state of unused bits in the value returned in RAX or XMM0 is undefined.
-User-defined types can be returned by value from global functions and static member functions. To return a user-defined type by value in RAX, it must have a length of 1, 2, 4, 8, 16, 32, or 64 bits. It must also have no user-defined constructor, destructor, or copy assignment operator. It can have no private or protected non-static data members, and no non-static data members of reference type. It can't have base classes or virtual functions. And, it can only have data members that also meet these requirements. (This definition is essentially the same as a C++03 POD type. Because the definition has changed in the C++11 standard, we don't recommend using `std::is_pod` for this test.) Otherwise, the caller must allocate memory for the return value and pass a pointer to it as the first argument. The remaining arguments are then shifted one argument to the right. The same pointer must be returned by the callee in RAX.
+User-defined types can be returned by value from global functions and static member functions. To return a user-defined type by value in RAX, it must have a length of 1, 2, 4, 8, 16, 32, or 64 bits. It must also have no user-defined constructor, destructor, or copy assignment operator. It can have no private or protected nonstatic data members, and no nonstatic data members of reference type. It can't have base classes or virtual functions. And, it can only have data members that also meet these requirements. This definition is essentially the same as a C++03 POD type. Because the definition has changed in the C++11 standard, we don't recommend using `std::is_pod` for this test. Otherwise, the caller must allocate memory for the return value and pass a pointer to it as the first argument. The remaining arguments are then shifted one argument to the right. The same pointer must be returned by the callee in RAX.
These examples show how parameters and return values are passed for functions with the specified declarations:
@@ -168,7 +169,7 @@ The x87 FPU control word register gets set using the following standard values a
| Register\[bits] | Setting |
|-|-|
-| FPCSR\[0:6] | Exception masks all 1's (all exceptions masked) |
+| FPCSR\[0:6] | Exception masks all 1s (all exceptions masked) |
| FPCSR\[7] | Reserved - 0 |
| FPCSR\[8:9] | Precision Control - 10B (double precision) |
| FPCSR\[10:11] | Rounding control - 0 (round to nearest) |
@@ -176,7 +177,7 @@ The x87 FPU control word register gets set using the following standard values a
A callee that modifies any of the fields within FPCSR must restore them before returning to its caller. Furthermore, a caller that has modified any of these fields must restore them to their standard values before invoking a callee, unless by agreement the callee expects the modified values.
-There are two exceptions to the rules about the non-volatility of the control flags:
+There are two exceptions to the rules about the nonvolatility of the control flags:
- In functions where the documented purpose of the given function is to modify the nonvolatile FPCSR flags.
@@ -191,13 +192,13 @@ The nonvolatile portion is set to the following standard values at the start of
| Register\[bits] | Setting |
|-|-|
| MXCSR\[6] | Denormals are zeros - 0 |
-| MXCSR\[7:12] | Exception masks all 1's (all exceptions masked) |
+| MXCSR\[7:12] | Exception masks all 1s (all exceptions masked) |
| MXCSR\[13:14] | Rounding control - 0 (round to nearest) |
| MXCSR\[15] | Flush to zero for masked underflow - 0 (off) |
A callee that modifies any of the nonvolatile fields within MXCSR must restore them before returning to its caller. Furthermore, a caller that has modified any of these fields must restore them to their standard values before invoking a callee, unless by agreement the callee expects the modified values.
-There are two exceptions to the rules about the non-volatility of the control flags:
+There are two exceptions to the rules about the nonvolatility of the control flags:
- In functions where the documented purpose of the given function is to modify the nonvolatile MXCSR flags.
@@ -207,10 +208,10 @@ Make no assumptions about the MXCSR register's volatile portion state across a f
## setjmp/longjmp
-When you include setjmpex.h or setjmp.h, all calls to [`setjmp`](../c-runtime-library/reference/setjmp.md) or [`longjmp`](../c-runtime-library/reference/longjmp.md) result in an unwind that invokes destructors and **`__finally`** calls. This behavior differs from x86, where including setjmp.h results in **`__finally`** clauses and destructors not being invoked.
+When you include `setjmpex.h` or `setjmp.h`, all calls to [`setjmp`](../c-runtime-library/reference/setjmp.md) or [`longjmp`](../c-runtime-library/reference/longjmp.md) result in an unwind that invokes destructors and `__finally` calls. This behavior differs from x86, where including `setjmp.h` results in `__finally` clauses and destructors not being invoked.
-A call to `setjmp` preserves the current stack pointer, non-volatile registers, and MXCSR registers. Calls to `longjmp` return to the most recent `setjmp` call site and resets the stack pointer, non-volatile registers, and MXCSR registers, back to the state as preserved by the most recent `setjmp` call.
+A call to `setjmp` preserves the current stack pointer, nonvolatile registers, and MXCSR registers. Calls to `longjmp` return to the most recent `setjmp` call site and resets the stack pointer, nonvolatile registers, and MXCSR registers, back to the state as preserved by the most recent `setjmp` call.
## See also
-[x64 software conventions](../build/x64-software-conventions.md)
+- [Overview of x64 ABI conventions](../build/x64-software-conventions.md)
diff --git a/docs/build/x64-software-conventions.md b/docs/build/x64-software-conventions.md
index 256fbdb581..fe644a1aa5 100644
--- a/docs/build/x64-software-conventions.md
+++ b/docs/build/x64-software-conventions.md
@@ -1,7 +1,7 @@
---
description: "Learn more about: x64 ABI conventions"
title: "x64 ABI conventions"
-ms.date: 04/21/2022
+ms.date: 03/28/2025
helpviewer_keywords: ["x64 coding conventions", "x64 abi", "Visual C++, x64 calling conventions"]
---
# Overview of x64 ABI conventions
@@ -11,10 +11,11 @@ This topic describes the basic application binary interface (ABI) for x64, the 6
## x64 calling conventions
Two important differences between x86 and x64 are:
+
- 64-bit addressing capability
- Sixteen 64-bit registers for general use.
-Given the expanded register set, x64 uses the [__fastcall](../cpp/fastcall.md) calling convention and a RISC-based exception-handling model.
+Given the expanded register set, x64 uses the [`__fastcall`](../cpp/fastcall.md) calling convention and a RISC-based exception-handling model.
The **`__fastcall`** convention uses registers for the first four arguments, and the stack frame to pass more arguments. For details on the x64 calling convention, including register usage, stack parameters, return values, and stack unwinding, see [x64 calling convention](x64-calling-convention.md).
@@ -116,7 +117,7 @@ _declspec(align(2)) struct {
}
```
-
+:::image type="content" source="../build/media/vcamd_conv_ex_1_block.png" alt-text="Diagram showing the structure layout for example 1. The diagram shows 2 bytes of memory. Member a, a short, occupies bytes 0 through 1.":::
#### Example 2
@@ -130,7 +131,9 @@ _declspec(align(8)) struct {
}
```
-
+:::image type="complex" source="../build/media/vcamd_conv_ex_2_block.png" alt-text="Diagram showing the structure layout for example 2.":::
+The diagram shows 24 bytes of memory. Member a, an int, occupies bytes 0 through 3. The diagram shows padding for bytes 4 through 7. Member b, a double, occupies bytes 8 through 15. Member c, a short, occupies bytes 16 through 17. Bytes 18 through 23 are unused.
+:::image-end:::
#### Example 3
@@ -145,7 +148,9 @@ _declspec(align(4)) struct {
}
```
-
+:::image type="complex" source="../build/media/vcamd_conv_ex_3_block.png" alt-text="Diagram showing the structure layout for example 3.":::
+The diagram shows 12 bytes of memory. Member a, a char, occupies byte 0. Byte 1 is padding. Member b, a short, occupies bytes 2 through 4. Member c, a char, occupies byte 4. Bytes 5 through 7 are padding. Member d, an int, occupies bytes 8 through 11.
+:::image-end:::
#### Example 4
@@ -159,7 +164,9 @@ _declspec(align(8)) union {
}
```
-
+:::image type="complex" source="../build/media/vcamd_conv_ex_4_block.png" alt-text="Diagram showing the union layout for example 4.":::
+The diagram shows 8 bytes of memory. Member p, a char, occupies byte 0. Member s, a short, occupies bytes 0 through 1. Member l, a long, occupies bytes 0 through 3. Bytes 4 through 7 are padding.
+:::image-end:::
### Bitfields
@@ -211,7 +218,7 @@ On function exit and on function entry to C Runtime Library calls and Windows sy
## Stack usage
-For details on stack allocation, alignment, function types and stack frames on x64, see [x64 stack usage](stack-usage.md).
+For details on stack allocation, alignment, function types, and stack frames on x64, see [x64 stack usage](stack-usage.md).
## Prolog and epilog
diff --git a/docs/c-language/c-enumeration-declarations.md b/docs/c-language/c-enumeration-declarations.md
index 77dc5ee661..08d1312b46 100644
--- a/docs/c-language/c-enumeration-declarations.md
+++ b/docs/c-language/c-enumeration-declarations.md
@@ -133,4 +133,4 @@ enum { yes, no } response;
## See also
-[Enumerations](../cpp/enumerations-cpp.md)
+[Enumerations(C++)](../cpp/enumerations-cpp.md)
diff --git a/docs/c-language/c-primary-expressions.md b/docs/c-language/c-primary-expressions.md
index 1b57eecbf0..b2939192a2 100644
--- a/docs/c-language/c-primary-expressions.md
+++ b/docs/c-language/c-primary-expressions.md
@@ -23,5 +23,5 @@ Primary expressions are the building blocks of more complex expressions. They ma
## See also
-[Generic selection](generic-selection.md)
+[Generic selection](generic-selection.md)\
[Operands and Expressions](../c-language/operands-and-expressions.md)
diff --git a/docs/c-language/demotion-of-integers.md b/docs/c-language/demotion-of-integers.md
index f64f4104f9..5cc14b1695 100644
--- a/docs/c-language/demotion-of-integers.md
+++ b/docs/c-language/demotion-of-integers.md
@@ -25,7 +25,7 @@ char y = (char)0x1234;
assigns the value 0x34 to `y`.
-When **`signed`** variables are converted to **`unsigned`** and vice-versa, the bit patterns remain the same. For example, casting -2 (0xFE) to an **`unsigned`** value yields 254 (also 0xFE).
+When **`signed`** variables are converted to **`unsigned`** and vice-versa, the bit patterns remain the same. For example, casting -2 (0xFFFFFFFE) to an **`unsigned int`** value yields 4294967294 (also 0xFFFFFFFE).
## See also
diff --git a/docs/c-language/extern-storage-class-specifier.md b/docs/c-language/extern-storage-class-specifier.md
index cfcf2a0c38..fc53268609 100644
--- a/docs/c-language/extern-storage-class-specifier.md
+++ b/docs/c-language/extern-storage-class-specifier.md
@@ -1,9 +1,8 @@
---
-description: "Learn more about: extern Storage-Class Specifier"
title: "extern Storage-Class Specifier"
+description: "Learn more about: extern Storage-Class Specifier"
ms.date: "07/10/2018"
helpviewer_keywords: ["extern keyword [C]", "storage class specifiers, extern", "extern keyword [C], storage class specifier", "external linkage, storage-class specifiers", "external linkage, extern modifier"]
-ms.assetid: 6e16d927-291f-49e4-986c-9d91a482a441
---
# extern Storage-Class Specifier
@@ -14,12 +13,11 @@ A variable declared with the **`extern`** storage-class specifier is a reference
This example illustrates internal- and external-level declarations:
```c
-
// Source1.c
int i = 1;
-// Source2. c
+// Source2.c
#include
diff --git a/docs/c-language/index.yml b/docs/c-language/index.yml
index feb5f6855e..3f038a096b 100644
--- a/docs/c-language/index.yml
+++ b/docs/c-language/index.yml
@@ -5,6 +5,7 @@ summary: Learn to use C and the C runtime library.
metadata:
title: C docs - get started, tutorials, reference.
description: C programming reference for users of Microsoft C/C++ and Visual Studio.
+ ms.author: twhitney
ms.topic: landing-page
ms.date: 05/28/2020
ms.custom: intro-landing-hub
diff --git a/docs/c-language/static-assert-c.md b/docs/c-language/static-assert-c.md
index dc8ab22981..0890f6594b 100644
--- a/docs/c-language/static-assert-c.md
+++ b/docs/c-language/static-assert-c.md
@@ -78,5 +78,5 @@ Windows SDK 10.0.20348.0 (version 2104) or later. For more information on instal
## See also
[`_STATIC_ASSERT` Macro](../c-runtime-library/reference/static-assert-macro.md)\
-[`assert` macro and `_assert` and `_wassert` functions](../c-runtime-library/reference/assert-macro-assert-wassert.md)
+[`assert` macro and `_assert` and `_wassert` functions](../c-runtime-library/reference/assert-macro-assert-wassert.md)\
[`/std` (Specify language standard version)](../build/reference/std-specify-language-standard-version.md)
diff --git a/docs/c-runtime-library/buffer-manipulation.md b/docs/c-runtime-library/buffer-manipulation.md
index 21c4336737..7fce41ba6c 100644
--- a/docs/c-runtime-library/buffer-manipulation.md
+++ b/docs/c-runtime-library/buffer-manipulation.md
@@ -1,9 +1,8 @@
---
-description: "Learn more about: Buffer manipulation"
title: "Buffer manipulation"
-ms.date: "04/04/2018"
+description: "Learn more about: Buffer manipulation"
+ms.date: 04/04/2018
helpviewer_keywords: ["buffers, manipulation routines", "buffers"]
-ms.assetid: 164f4860-ce66-412c-8291-396fbd70f03e
---
# Buffer manipulation
@@ -13,17 +12,17 @@ Use these routines to work with areas of memory on a byte-by-byte basis.
| Routine | Use |
|---|---|
-| [`_memccpy`](./reference/memccpy.md) | Copy characters from one buffer to another until given character or given number of characters has been copied |
-| [`memchr`, `wmemchr`](./reference/memchr-wmemchr.md) | Return pointer to first occurrence, within specified number of characters, of given character in buffer |
-| [`memcmp`, `wmemcmp`](./reference/memcmp-wmemcmp.md) | Compare specified number of characters from two buffers |
-| [`memcpy`, `wmemcpy`](./reference/memcpy-wmemcpy.md), [`memcpy_s`, `wmemcpy_s`](./reference/memcpy-s-wmemcpy-s.md) | Copy specified number of characters from one buffer to another |
-| [`_memicmp`, `_memicmp_l`](./reference/memicmp-memicmp-l.md) | Compare specified number of characters from two buffers without regard to case |
-| [`memmove`, `wmemmove`](./reference/memmove-wmemmove.md),[`memmove_s`, `wmemmove_s`](./reference/memmove-s-wmemmove-s.md) | Copy specified number of characters from one buffer to another |
-| [`memset`, `wmemset`](./reference/memset-wmemset.md) | Use given character to initialize specified number of bytes in the buffer |
-| [`_swab`](./reference/swab.md) | Swap bytes of data and store them at specified location |
+| [`_memccpy`](reference/memccpy.md) | Copy characters from one buffer to another until given character or given number of characters has been copied |
+| [`memchr`, `wmemchr`](reference/memchr-wmemchr.md) | Return pointer to first occurrence, within specified number of characters, of given character in buffer |
+| [`memcmp`, `wmemcmp`](reference/memcmp-wmemcmp.md) | Compare specified number of characters from two buffers |
+| [`memcpy`, `wmemcpy`](reference/memcpy-wmemcpy.md), [`memcpy_s`, `wmemcpy_s`](reference/memcpy-s-wmemcpy-s.md) | Copy specified number of characters from one buffer to another |
+| [`_memicmp`, `_memicmp_l`](reference/memicmp-memicmp-l.md) | Compare specified number of characters from two buffers without regard to case |
+| [`memmove`, `wmemmove`](reference/memmove-wmemmove.md), [`memmove_s`, `wmemmove_s`](reference/memmove-s-wmemmove-s.md) | Copy specified number of characters from one buffer to another |
+| [`memset`, `wmemset`](reference/memset-wmemset.md) | Use given character to initialize specified number of bytes in the buffer |
+| [`_swab`](reference/swab.md) | Swap bytes of data and store them at specified location |
When the source and target areas overlap, only `memmove` is guaranteed to copy the full source properly.
## See also
-[Universal C runtime routines by category](./run-time-routines-by-category.md)
+[Universal C runtime routines by category](run-time-routines-by-category.md)
diff --git a/docs/c-runtime-library/crt-debug-heap-details.md b/docs/c-runtime-library/crt-debug-heap-details.md
index ffef146716..5a0d180c7d 100644
--- a/docs/c-runtime-library/crt-debug-heap-details.md
+++ b/docs/c-runtime-library/crt-debug-heap-details.md
@@ -102,14 +102,11 @@ typedef struct _CrtMemBlockHeader
The `no_mans_land` buffers on either side of the user data area of the block are currently 4 bytes in size, and are filled with a known byte value used by the debug heap routines to verify that the limits of the user's memory block haven't been overwritten. The debug heap also fills new memory blocks with a known value. If you elect to keep freed blocks in the heap's linked list, these freed blocks are also filled with a known value. Currently, the actual byte values used are as follows:
-`no_mans_land` (0xFD)\
-The "no_mans_land" buffers on either side of the memory used by an application are currently filled with 0xFD.
-
-Freed blocks (0xDD)\
-The freed blocks kept unused in the debug heap's linked list when the `_CRTDBG_DELAY_FREE_MEM_DF` flag is set are currently filled with 0xDD.
-
-New objects (0xCD)\
-New objects are filled with 0xCD when they're allocated.
+|Code |Description |
+|---------|---------|
+|`no_mans_land` (0xFD) | The "no_mans_land" buffers on either side of the memory used by an application are currently filled with 0xFD. |
+|Freed blocks (0xDD) | The freed blocks kept unused in the debug heap's linked list when the `_CRTDBG_DELAY_FREE_MEM_DF` flag is set are currently filled with 0xDD. |
+|New objects (0xCD) | New objects are filled with 0xCD when they're allocated.|
## Types of blocks on the debug heap
@@ -170,7 +167,7 @@ All calls to heap functions such as `malloc`, `free`, `calloc`, `realloc`, `new`
### To use the debug heap
-- Link the debug build of your application with a debug version of the C runtime library.
+Link the debug build of your application with a debug version of the C runtime library.
### To change one or more `_crtDbgFlag` bit fields and create a new state for the flag
@@ -275,9 +272,9 @@ Knowing the source file name and line number of an assert or reporting macro is
### Unique allocation request numbers and `_crtBreakAlloc`
-There's a simple way to identify the specific heap allocation call that went bad. It takes advantage of the unique allocation request number associated with each block in the debug heap. When information about a block is reported by one of the dump functions, this allocation request number is enclosed in braces (for example, "{36}").
+There's a simple way to identify the specific heap allocation call that went bad. It takes advantage of the unique allocation request number associated with each block in the debug heap. When information about a block is reported by one of the dump functions, this allocation request number is enclosed in braces. For example, `{36}`.
-Once you know the allocation request number of an improperly allocated block, you can pass this number to [`_CrtSetBreakAlloc`](./reference/crtsetbreakalloc.md) to create a breakpoint. Execution will break just before allocating the block, and you can backtrack to determine what routine was responsible for the bad call. To avoid recompiling, you can accomplish the same thing in the debugger by setting `_crtBreakAlloc` to the allocation request number you're interested in.
+Once you know the allocation request number of an improperly allocated block, you can pass this number to [`_CrtSetBreakAlloc`](./reference/crtsetbreakalloc.md) to create a breakpoint. Execution will break just before allocating the block and you can backtrack to determine what routine was responsible for the bad call. To avoid recompiling, you can accomplish the same thing in the debugger by setting `_crtBreakAlloc` to the allocation request number you're interested in.
### Creating debug versions of your allocation routines
diff --git a/docs/c-runtime-library/crt-debugging-techniques.md b/docs/c-runtime-library/crt-debugging-techniques.md
index a2379c0484..39d625f0e1 100644
--- a/docs/c-runtime-library/crt-debugging-techniques.md
+++ b/docs/c-runtime-library/crt-debugging-techniques.md
@@ -169,5 +169,5 @@ If the hook handles the message in question completely, so that no further repor
## See also
-- [Debugging Native Code](/visualstudio/debugger/debugging-native-code.md)
-- [Debugger Security](/visualstudio/debugger/debugger-security.md)
+- [Debugging Native Code](/visualstudio/debugger/debugging-native-code)
+- [Debugger Security](/visualstudio/debugger/debugger-security)
diff --git a/docs/c-runtime-library/data-alignment.md b/docs/c-runtime-library/data-alignment.md
index e9c8d32d66..97b03773fb 100644
--- a/docs/c-runtime-library/data-alignment.md
+++ b/docs/c-runtime-library/data-alignment.md
@@ -1,10 +1,9 @@
---
-description: "Learn more about: Data Alignment"
title: "Data Alignment"
-ms.date: "11/04/2016"
+description: "Learn more about: Data Alignment"
+ms.date: 11/04/2016
f1_keywords: ["data.alignment"]
helpviewer_keywords: ["data alignment [C++]"]
-ms.assetid: 35ac3d2d-a4b3-421b-954f-b7372b1f18e1
---
# Data alignment
@@ -14,7 +13,7 @@ The following C run-time functions support data alignment.
| Routine | Use |
|---|---|
-| [`_aligned_free`](./reference/aligned-free.md) | Frees a block of memory that was allocated with [`_aligned_malloc`](./reference/aligned-malloc.md)or [`_aligned_offset_malloc`](./reference/aligned-offset-malloc.md). |
+| [`_aligned_free`](./reference/aligned-free.md) | Frees a block of memory that was allocated with [`_aligned_malloc`](./reference/aligned-malloc.md) or [`_aligned_offset_malloc`](./reference/aligned-offset-malloc.md). |
| [`_aligned_free_dbg`](./reference/aligned-free-dbg.md) | Frees a block of memory that was allocated with [`_aligned_malloc`](./reference/aligned-malloc.md) or [`_aligned_offset_malloc`](./reference/aligned-offset-malloc.md) (debug only). |
| [`_aligned_malloc`](./reference/aligned-malloc.md) | Allocates memory on a specified alignment boundary. |
| [`_aligned_malloc_dbg`](./reference/aligned-malloc-dbg.md) | Allocates memory on a specified alignment boundary with extra space for a debugging header and overwrite buffers (debug version only). |
diff --git a/docs/c-runtime-library/file-handling.md b/docs/c-runtime-library/file-handling.md
index 9ff1cf7924..661f7a0fb3 100644
--- a/docs/c-runtime-library/file-handling.md
+++ b/docs/c-runtime-library/file-handling.md
@@ -1,16 +1,15 @@
---
-description: "Learn more about: File Handling"
title: "File Handling"
-ms.date: "11/04/2016"
+description: "Learn more about: File Handling"
+ms.date: 11/04/2016
f1_keywords: ["c.files"]
helpviewer_keywords: ["files [C++], handling", "files [C++], opening", "files [C++], manipulating"]
-ms.assetid: 48119e2e-e94f-4602-b08b-b72440f731d8
---
# File handling
Use these routines to create, delete, and manipulate files and to set and check file-access permissions.
-The C run-time libraries have a 512 limit for the number of files that can be open at any one time. Attempting to open more than the maximum number of file descriptors or file streams causes program failure. Use [`_setmaxstdio`](./reference/setmaxstdio.md) to change this number.
+The C run-time libraries have a 512 limit for the number of files that can be open at any one time. Attempting to open more than the maximum number of file descriptors or file streams causes program failure. Use [`_setmaxstdio`](reference/setmaxstdio.md) to change this number.
## File-handling routines (file descriptor)
@@ -18,14 +17,14 @@ These routines operate on files designated by a file descriptor.
| Routine | Use |
|---|---|
-| [`_chsize`](./reference/chsize.md),[`_chsize_s`](./reference/chsize-s.md) | Change file size |
-| [`_filelength`, `_filelengthi64`](./reference/filelength-filelengthi64.md) | Get file length |
-| [`_fstat`, `_fstat32`, `_fstat64`, `_fstati64`, `_fstat32i64`, `_fstat64i32`](./reference/fstat-fstat32-fstat64-fstati64-fstat32i64-fstat64i32.md) | Get file-status information on descriptor |
-| [`_get_osfhandle`](./reference/get-osfhandle.md) | Return operating-system file handle associated with existing C run-time file descriptor |
-| [`_isatty`](./reference/isatty.md) | Check for character device |
-| [`_locking`](./reference/locking.md) | Lock areas of file |
-| [`_open_osfhandle`](./reference/open-osfhandle.md) | Associate C run-time file descriptor with existing operating-system file handle |
-| [`_setmode`](./reference/setmode.md) | Set file-translation mode |
+| [`_chsize`](reference/chsize.md), [`_chsize_s`](reference/chsize-s.md) | Change file size |
+| [`_filelength`, `_filelengthi64`](reference/filelength-filelengthi64.md) | Get file length |
+| [`_fstat`, `_fstat32`, `_fstat64`, `_fstati64`, `_fstat32i64`, `_fstat64i32`](reference/fstat-fstat32-fstat64-fstati64-fstat32i64-fstat64i32.md) | Get file-status information on descriptor |
+| [`_get_osfhandle`](reference/get-osfhandle.md) | Return operating-system file handle associated with existing C run-time file descriptor |
+| [`_isatty`](reference/isatty.md) | Check for character device |
+| [`_locking`](reference/locking.md) | Lock areas of file |
+| [`_open_osfhandle`](reference/open-osfhandle.md) | Associate C run-time file descriptor with existing operating-system file handle |
+| [`_setmode`](reference/setmode.md) | Set file-translation mode |
## File-Handling Routines (Path or Filename)
@@ -33,17 +32,17 @@ These routines operate on files specified by a path or filename.
| Routine | Use |
|---|---|
-| [`_access`, `_waccess`](./reference/access-waccess.md), [`_access_s`, `_waccess_s`](./reference/access-s-waccess-s.md) | Check file-permission setting |
-| [`_chmod`, `_wchmod`](./reference/chmod-wchmod.md) | Change file-permission setting |
-| [`_fullpath`, `_wfullpath`](./reference/fullpath-wfullpath.md) | Expand a relative path to its absolute path name |
-| [`_makepath`, `_wmakepath`](./reference/makepath-wmakepath.md), [`_makepath_s`, `_wmakepath_s`](./reference/makepath-s-wmakepath-s.md) | Merge path components into single, full path |
-| [`_mktemp`, `_wmktemp`](./reference/mktemp-wmktemp.md), [`_mktemp_s`, `_wmktemp_s`](./reference/mktemp-s-wmktemp-s.md) | Create unique filename |
-| [`remove`, `_wremove`](./reference/remove-wremove.md) | Delete file |
-| [`rename`, `_wrename`](./reference/rename-wrename.md) | Rename file |
-| [`_splitpath`, `_wsplitpath`](./reference/splitpath-wsplitpath.md), [`_splitpath_s`, `_wsplitpath_s`](./reference/splitpath-s-wsplitpath-s.md) | Parse path into components |
-| [`_stat`, `_stat64`, `_stati64`, `_wstat`, `_wstat64`, `_wstati64`](./reference/stat-functions.md) | Get file-status information on named file |
-| [`_umask`](./reference/umask.md), [`_umask_s`](./reference/umask-s.md) | Set default permission mask for new files created by program |
-| [`_unlink`, `_wunlink`](./reference/unlink-wunlink.md) | Delete file |
+| [`_access`, `_waccess`](reference/access-waccess.md), [`_access_s`, `_waccess_s`](reference/access-s-waccess-s.md) | Check file-permission setting |
+| [`_chmod`, `_wchmod`](reference/chmod-wchmod.md) | Change file-permission setting |
+| [`_fullpath`, `_wfullpath`](reference/fullpath-wfullpath.md) | Expand a relative path to its absolute path name |
+| [`_makepath`, `_wmakepath`](reference/makepath-wmakepath.md), [`_makepath_s`, `_wmakepath_s`](reference/makepath-s-wmakepath-s.md) | Merge path components into single, full path |
+| [`_mktemp`, `_wmktemp`](reference/mktemp-wmktemp.md), [`_mktemp_s`, `_wmktemp_s`](reference/mktemp-s-wmktemp-s.md) | Create unique filename |
+| [`remove`, `_wremove`](reference/remove-wremove.md) | Delete file |
+| [`rename`, `_wrename`](reference/rename-wrename.md) | Rename file |
+| [`_splitpath`, `_wsplitpath`](reference/splitpath-wsplitpath.md), [`_splitpath_s`, `_wsplitpath_s`](reference/splitpath-s-wsplitpath-s.md) | Parse path into components |
+| [`_stat`, `_stat64`, `_stati64`, `_wstat`, `_wstat64`, `_wstati64`](reference/stat-functions.md) | Get file-status information on named file |
+| [`_umask`](reference/umask.md), [`_umask_s`](reference/umask-s.md) | Set default permission mask for new files created by program |
+| [`_unlink`, `_wunlink`](reference/unlink-wunlink.md) | Delete file |
## File-Handling Routines (Open File)
@@ -51,32 +50,30 @@ These routines open files.
| Routine | Use |
|---|---|
-| [`fopen`, `_wfopen`](./reference/fopen-wfopen.md), [`fopen_s`, `_wfopen_s`](./reference/fopen-s-wfopen-s.md) | Opens a file and returns a pointer to the open file. |
-| [`_fsopen`, `_wfsopen`](./reference/fsopen-wfsopen.md) | Open a stream with file sharing and returns a pointer to the open file. |
-| [`_open`, `_wopen`](./reference/open-wopen.md) | Opens a file and returns a file descriptor to the opened file. |
-| [`_sopen`, `_wsopen`](./reference/sopen-wsopen.md), [`_sopen_s`, `_wsopen_s`](./reference/sopen-s-wsopen-s.md) | Open a file with file sharing and returns a file descriptor to the open file. |
-| [`_pipe`](./reference/pipe.md) | Creates a pipe for reading and writing. |
-| [`freopen`, `_wfreopen`](./reference/freopen-wfreopen.md), [`freopen_s`, `_wfreopen_s`](./reference/freopen-s-wfreopen-s.md) | Reassign a file pointer. |
+| [`fopen`, `_wfopen`](reference/fopen-wfopen.md), [`fopen_s`, `_wfopen_s`](reference/fopen-s-wfopen-s.md) | Opens a file and returns a pointer to the open file. |
+| [`_fsopen`, `_wfsopen`](reference/fsopen-wfsopen.md) | Open a stream with file sharing and returns a pointer to the open file. |
+| [`_open`, `_wopen`](reference/open-wopen.md) | Opens a file and returns a file descriptor to the opened file. |
+| [`_sopen`, `_wsopen`](reference/sopen-wsopen.md), [`_sopen_s`, `_wsopen_s`](reference/sopen-s-wsopen-s.md) | Open a file with file sharing and returns a file descriptor to the open file. |
+| [`_pipe`](reference/pipe.md) | Creates a pipe for reading and writing. |
+| [`freopen`, `_wfreopen`](reference/freopen-wfreopen.md), [`freopen_s`, `_wfreopen_s`](reference/freopen-s-wfreopen-s.md) | Reassign a file pointer. |
These routines provide a way to change the representation of the file between a `FILE` structure, a file descriptor, and a Win32 file handle.
| Routine | Use |
|---|---|
-| [`_fdopen`, `_wfdopen`](./reference/fdopen-wfdopen.md) | Associates a stream with a file that was previously opened for low-level I/O and returns a pointer to the open stream. |
-| [`_fileno`](./reference/fileno.md) | Gets the file descriptor associated with a stream. |
-| [`_get_osfhandle`](./reference/get-osfhandle.md) | Return operating-system file handle associated with existing C run-time file descriptor |
-| [`_open_osfhandle`](./reference/open-osfhandle.md) | Associates C run-time file descriptor with an existing operating-system file handle. |
+| [`_fdopen`, `_wfdopen`](reference/fdopen-wfdopen.md) | Associates a stream with a file that was previously opened for low-level I/O and returns a pointer to the open stream. |
+| [`_fileno`](reference/fileno.md) | Gets the file descriptor associated with a stream. |
+| [`_get_osfhandle`](reference/get-osfhandle.md) | Return operating-system file handle associated with existing C run-time file descriptor |
+| [`_open_osfhandle`](reference/open-osfhandle.md) | Associates C run-time file descriptor with an existing operating-system file handle. |
The following Win32 functions also open files and pipes:
- [`CreateFile`](/windows/win32/api/fileapi/nf-fileapi-createfilew)
-
- [`CreatePipe`](/windows/win32/api/namedpipeapi/nf-namedpipeapi-createpipe)
-
- [`CreateNamedPipe`](/windows/win32/api/winbase/nf-winbase-createnamedpipea)
## See also
-[Universal C runtime routines by category](./run-time-routines-by-category.md)\
-[Directory control](./directory-control.md)\
-[System calls](./system-calls.md)
+[Universal C runtime routines by category](run-time-routines-by-category.md)\
+[Directory control](directory-control.md)\
+[System calls](system-calls.md)
diff --git a/docs/c-runtime-library/find-memory-leaks-using-the-crt-library.md b/docs/c-runtime-library/find-memory-leaks-using-the-crt-library.md
index dea101aead..1e78d27ce5 100644
--- a/docs/c-runtime-library/find-memory-leaks-using-the-crt-library.md
+++ b/docs/c-runtime-library/find-memory-leaks-using-the-crt-library.md
@@ -2,7 +2,7 @@
title: Find memory leaks with the CRT library
description: Learn how the C/C++ debugger and C Run-time Library (CRT) can help find memory leaks. The techniques include memory-leak reports and comparing memory snapshots.
ms.date: 02/03/2023
-helpviewer_keywords:
+helpviewer_keywords:
- breakpoints, on memory allocation
- _CrtMemState
- _CrtMemCheckpoint
@@ -165,7 +165,7 @@ struct Pod {
int x;
};
-void main() {
+int main() {
Pod* pPod = DBG_NEW Pod;
pPod = DBG_NEW Pod; // Oops, leaked the original pPod!
delete pPod;
@@ -216,7 +216,7 @@ You can use the allocation number to set a breakpoint on the memory allocation.
After you set a breakpoint on a memory-allocation number, continue to debug. Make sure to run under the same conditions, so the memory-allocation number doesn't change. When your program breaks at the specified memory allocation, use the **Call Stack** window and other debugger windows to determine the conditions under which the memory was allocated. Then, you can continue execution to observe what happens to the object and determine why it isn't correctly deallocated.
-Setting a data breakpoint on the object might also be helpful. For more information, see [Using breakpoints](/visualstudio/debugger/using-breakpoints.md).
+Setting a data breakpoint on the object might also be helpful. For more information, see [Using breakpoints](/visualstudio/debugger/using-breakpoints).
You can also set memory-allocation breakpoints in code. You can set:
@@ -241,7 +241,7 @@ _CrtMemCheckpoint( &s1 );
The `_CrtMemCheckpoint` function fills in the structure with a snapshot of the current memory state.
-To output the contents of a `_CrtMemState` structure, pass the structure to the `_ CrtMemDumpStatistics` function:
+To output the contents of a `_CrtMemState` structure, pass the structure to the `_CrtMemDumpStatistics` function:
```cpp
_CrtMemDumpStatistics( &s1 );
@@ -281,5 +281,5 @@ One technique for finding memory leaks begins by placing `_CrtMemCheckpoint` cal
## See also
- [CRT debug heap details](./crt-debug-heap-details.md)
-- [Debugger security](/visualstudio/debugger/debugger-security.md)
-- [Debugging native code](/visualstudio/debugger/debugging-native-code.md)
+- [Debugger security](/visualstudio/debugger/debugger-security)
+- [Debugging native code](/visualstudio/debugger/debugging-native-code)
diff --git a/docs/c-runtime-library/floating-point-support.md b/docs/c-runtime-library/floating-point-support.md
index 69a51ce7ce..7f4ac7bc98 100644
--- a/docs/c-runtime-library/floating-point-support.md
+++ b/docs/c-runtime-library/floating-point-support.md
@@ -11,7 +11,9 @@ The Universal C Runtime library (UCRT) provides many integral and floating-point
For ISO C Standard 11 (C11) and later, the `` header, in addition to including `` and ``, provides macros that invoke a corresponding math function based on the types of the parameters. See [Type-generic math](tgmath.md) for details.
-Many of the floating point math library functions have different implementations for different CPU architectures. For example, the 32-bit x86 CRT may have a different implementation than the 64-bit x64 CRT. In addition, some of the functions may have multiple implementations for a given CPU architecture. The most efficient implementation is selected dynamically at run-time depending on the instruction sets supported by the CPU. For example, in the 32-bit x86 CRT, some functions have both an x87 implementation and an SSE2 implementation. When running on a CPU that supports SSE2, the faster SSE2 implementation is used. When running on a CPU that doesn't support SSE2, the slower x87 implementation is used. Because different implementations of the math library functions may use different CPU instructions and different algorithms to produce their results, the functions may produce different results across CPUs. In most cases, the results are within +/-1 ULP of the correctly rounded result, but the actual results may vary across CPUs.
+Many of the floating-point math library functions have different implementations for different CPU architectures. For example, the 32-bit x86 CRT may have a different implementation than the 64-bit x64 CRT. In addition, some of the functions may have multiple implementations for a given CPU architecture. The most efficient implementation is selected dynamically at run-time depending on the instruction sets supported by the CPU. For example, in the 32-bit x86 CRT, some functions have both an x87 implementation and an SSE2 implementation. When running on a CPU that supports SSE2, the faster SSE2 implementation is used. When running on a CPU that doesn't support SSE2, the slower x87 implementation is used. Because different implementations of the math library functions may use different CPU instructions and different algorithms to produce their results, the functions may produce different results across CPUs. In most cases, the results are within +/-1 ULP of the correctly rounded result, but the actual results may vary across CPUs.
+
+Newer versions of the UCRT might improve the precision and accuracy of the floating-point math library functions. Since the UCRT is part of the Windows operating system, you might get different results for these functions on different operating system versions or between debug and release builds. Although it is not recommended, you can statically link to the UCRT to guarantee consistent results if you need these functions will produce identical results everywhere.
Previous 16-bit versions of Microsoft C/C++ and Microsoft Visual C++ supported the **`long double`** type as an 80-bit precision floating-point data type. In later versions of Visual C++, the **`long double`** data type is a 64-bit precision floating-point data type identical to the **`double`** type. The compiler treats **`long double`** and **`double`** as distinct types, but the **`long double`** functions are identical to their **`double`** counterparts. The CRT provides **`long double`** versions of the math functions for ISO C99 source code compatibility, but note that the binary representation may differ from other compilers.
@@ -79,7 +81,7 @@ Previous 16-bit versions of Microsoft C/C++ and Microsoft Visual C++ supported t
| [`imaxabs`](./reference/imaxabs.md) | Computes the absolute value of an integer type |
| [`imaxdiv`](./reference/imaxdiv.md) | Computes the quotient and the remainder of two integer values |
| [`isfinite`, `_finite`, `_finitef`](./reference/finite-finitef.md) | Determines whether a value is finite |
-| [`isgreater`, `isgreaterequal`, `isless`, `islessequal`, `islessgreater`, `isunordered`](./reference/floating-point-ordering.md) | Compare the order of two floating point values |
+| [`isgreater`, `isgreaterequal`, `isless`, `islessequal`, `islessgreater`, `isunordered`](./reference/floating-point-ordering.md) | Compare the order of two floating-point values |
| [`isinf`](./reference/isinf.md) | Determines whether a floating-point value is infinite |
| [`isnan`, `_isnan`, `_isnanf`](./reference/isnan-isnan-isnanf.md) | Tests a floating-point value for NaN |
| [`isnormal`](./reference/isnormal.md) | Tests whether a floating-point value is both finite and not subnormal |
diff --git a/docs/c-runtime-library/heapset.md b/docs/c-runtime-library/heapset.md
index 98b435fbb4..71dcd09725 100644
--- a/docs/c-runtime-library/heapset.md
+++ b/docs/c-runtime-library/heapset.md
@@ -1,6 +1,6 @@
---
-description: "Learn more about: _heapset"
title: "_heapset"
+description: "Learn more about: _heapset"
ms.date: "11/04/2016"
api_name: ["_heapset"]
api_location: ["msvcr90.dll", "msvcr80.dll", "msvcr110.dll", "msvcr110_clr0400.dll", "msvcrt.dll", "msvcr120.dll", "msvcr100.dll"]
@@ -8,7 +8,6 @@ api_type: ["DLLExport"]
topic_type: ["apiref"]
f1_keywords: ["_heapset", "heapset"]
helpviewer_keywords: ["checking heap", "heapset function", "heaps, checking", "debugging [CRT], heap-related problems", "_heapset function"]
-ms.assetid: 9667eeb0-55bc-4c19-af5f-d1fd0a142b3c
---
# `_heapset`
@@ -47,7 +46,7 @@ In addition, if an error occurs, **`_heapset`** sets `errno` to `ENOSYS`.
The **`_heapset`** function shows free memory locations or nodes that have been unintentionally overwritten.
-**`_heapset`** checks for minimal consistency on the heap and then sets each byte of the heap's free entries to the `fill` value. This known value shows which memory locations of the heap contain free nodes and which contain data that were unintentionally written to freed memory. If the operating system doesn't support **`_heapset`**(for example, Windows 98), the function returns `_HEAPOK` and sets `errno` to `ENOSYS`.
+**`_heapset`** checks for minimal consistency on the heap and then sets each byte of the heap's free entries to the `fill` value. This known value shows which memory locations of the heap contain free nodes and which contain data that were unintentionally written to freed memory. If the operating system doesn't support **`_heapset`** (for example, Windows 98), the function returns `_HEAPOK` and sets `errno` to `ENOSYS`.
## Requirements
diff --git a/docs/c-runtime-library/is-isw-routines.md b/docs/c-runtime-library/is-isw-routines.md
index ed95473112..749a96439b 100644
--- a/docs/c-runtime-library/is-isw-routines.md
+++ b/docs/c-runtime-library/is-isw-routines.md
@@ -1,6 +1,6 @@
---
-description: "Learn more about: is, isw Routines"
title: "is, isw Routines"
+description: "Learn more about: is, isw Routines"
ms.date: 01/11/2022
helpviewer_keywords: ["is routines", "isw routines"]
---
@@ -15,7 +15,7 @@ helpviewer_keywords: ["is routines", "isw routines"]
[`iscntrl`, `iswcntrl`, `_iscntrl_l`, `_iswcntrl_l`](./reference/iscntrl-iswcntrl-iscntrl-l-iswcntrl-l.md)\
[`iscsym`, `iscsymf`, `__iscsym`, `__iswcsym`, `__iscsymf`, `__iswcsymf`, `_iscsym_l`, `_iswcsym_l`, `_iscsymf_l`, `_iswcsymf_l`](./reference/iscsym-functions.md)\
[`_isctype`, `iswctype`, `_isctype_l`, `_iswctype_l`](./reference/isctype-iswctype-isctype-l-iswctype-l.md)\
- [`isdigit`, `iswdigit`, `_isdigit_l`, `_iswdigit_l`](./reference/isdigit-iswdigit-isdigit-l-iswdigit-l.md)
+ [`isdigit`, `iswdigit`, `_isdigit_l`, `_iswdigit_l`](./reference/isdigit-iswdigit-isdigit-l-iswdigit-l.md)\
[`isgraph`, `iswgraph`, `_isgraph_l`, `_iswgraph_l`](./reference/isgraph-iswgraph-isgraph-l-iswgraph-l.md)\
[`isleadbyte`, `_isleadbyte_l`](./reference/isleadbyte-isleadbyte-l.md)\
[`islower`, `iswlower`, `_islower_l`, `_iswlower_l`](./reference/islower-iswlower-islower-l-iswlower-l.md)\
diff --git a/docs/c-runtime-library/ismbc-routines.md b/docs/c-runtime-library/ismbc-routines.md
index b941bbcf3c..7c7a33362c 100644
--- a/docs/c-runtime-library/ismbc-routines.md
+++ b/docs/c-runtime-library/ismbc-routines.md
@@ -1,41 +1,40 @@
---
-description: "Learn more about: _ismbc Routines"
title: "_ismbc Routines"
+description: "Learn more about: _ismbc Routines"
ms.date: "11/04/2016"
helpviewer_keywords: ["ismbc routines", "_ismbc routines"]
-ms.assetid: b8995391-7857-4ac3-9a1e-de946eb4464d
---
# `_ismbc` routines
Each `_ismbc` routine tests a given multibyte character `c` for a particular condition.
-- [`_ismbcalnum`, `_ismbcalnum_l`, `_ismbcalpha`, `_ismbcalpha_l`, `_ismbcdigit`, `_ismbcdigit_l`](./reference/ismbcalnum-functions.md)\
-- [`_ismbcl0`, `_ismbcl0_l`, `_ismbcl1`, `_ismbcl1_l`, `_ismbcl2`, `_ismbcl2_l`](./reference/ismbcl0-ismbcl0-l-ismbcl1-ismbcl1-l-ismbcl2-ismbcl2-l.md)\
-- [`_ismbcgraph`, `_ismbcgraph_l`, `_ismbcprint`, `_ismbcprint_l`, `_ismbcpunct`, `_ismbcpunct_l`, `_ismbcblank`, `_ismbcblank_l`, `_ismbcspace`, `_ismbcspace_l`](./reference/ismbcgraph-functions.md)\
-- [`_ismbclegal`, `_ismbclegal_l`, `_ismbcsymbol`, `_ismbcsymbol_l`](./reference/ismbclegal-ismbclegal-l-ismbcsymbol-ismbcsymbol-l.md)\
-- [`_ismbchira`, `_ismbchira_l`, `_ismbckata`, `_ismbckata_l`](./reference/ismbchira-ismbchira-l-ismbckata-ismbckata-l.md)\
-- [`_ismbclower`, `_ismbclower_l`, `_ismbcupper`, `_ismbcupper_l`](./reference/ismbclower-ismbclower-l-ismbcupper-ismbcupper-l.md)
+- [`_ismbcalnum`, `_ismbcalnum_l`, `_ismbcalpha`, `_ismbcalpha_l`, `_ismbcdigit`, `_ismbcdigit_l`](reference/ismbcalnum-functions.md)
+- [`_ismbcl0`, `_ismbcl0_l`, `_ismbcl1`, `_ismbcl1_l`, `_ismbcl2`, `_ismbcl2_l`](reference/ismbcl0-ismbcl0-l-ismbcl1-ismbcl1-l-ismbcl2-ismbcl2-l.md)
+- [`_ismbcgraph`, `_ismbcgraph_l`, `_ismbcprint`, `_ismbcprint_l`, `_ismbcpunct`, `_ismbcpunct_l`, `_ismbcblank`, `_ismbcblank_l`, `_ismbcspace`, `_ismbcspace_l`](reference/ismbcgraph-functions.md)
+- [`_ismbclegal`, `_ismbclegal_l`, `_ismbcsymbol`, `_ismbcsymbol_l`](reference/ismbclegal-ismbclegal-l-ismbcsymbol-ismbcsymbol-l.md)
+- [`_ismbchira`, `_ismbchira_l`, `_ismbckata`, `_ismbckata_l`](reference/ismbchira-ismbchira-l-ismbckata-ismbckata-l.md)
+- [`_ismbclower`, `_ismbclower_l`, `_ismbcupper`, `_ismbcupper_l`](reference/ismbclower-ismbclower-l-ismbcupper-ismbcupper-l.md)
## Remarks
-The test result of each `_ismbc` routine depends on the multibyte code page in effect. Multibyte code pages have single-byte alphabetic characters. By default, the multibyte code page is set to the system-default ANSI code page obtained from the operating system at program startup. You can query or change the multibyte code page in use with [`_getmbcp`](./reference/getmbcp.md) or [`_setmbcp`](./reference/setmbcp.md), respectively.
+The test result of each `_ismbc` routine depends on the multibyte code page in effect. Multibyte code pages have single-byte alphabetic characters. By default, the multibyte code page is set to the system-default ANSI code page obtained from the operating system at program startup. You can query or change the multibyte code page in use with [`_getmbcp`](reference/getmbcp.md) or [`_setmbcp`](reference/setmbcp.md), respectively.
-The output value is affected by the `LC_CTYPE` category setting of the locale. For more information, see [`setlocale`](./reference/setlocale-wsetlocale.md). The versions of these functions without the `_l` suffix use the current locale for this locale-dependent behavior; the versions with the `_l` suffix are identical except that they use the locale parameter passed in instead.
+The output value is affected by the `LC_CTYPE` category setting of the locale. For more information, see [`setlocale`](reference/setlocale-wsetlocale.md). The versions of these functions without the `_l` suffix use the current locale for this locale-dependent behavior; the versions with the `_l` suffix are identical except that they use the locale parameter passed in instead.
| Routine | Test condition | Code page 932 example |
|---|---|---|
-| [`_ismbcalnum`, `_ismbcalnum_l`](./reference/ismbcalnum-functions.md) | Alphanumeric | Returns nonzero if and only if `c` is a single-byte representation of an ASCII English letter: See examples for `_ismbcdigit` and `_ismbcalpha`. |
-| [`_ismbcalpha`, `_ismbcalpha_l`](./reference/ismbcalnum-functions.md) | Alphabetic | Returns nonzero if and only if `c` is a single-byte representation of an ASCII English letter: See examples for `_ismbcupper` and `_ismbclower`; or a katakana letter: 0xA6<=`c`<=0xDF. |
-| [`_ismbcdigit`, `_ismbcdigit_l`](./reference/ismbcalnum-functions.md) | Digit | Returns nonzero if and only if `c` is a single-byte representation of an ASCII digit: 0x30<=`c`<=0x39. |
-| [`_ismbcgraph`, `_ismbcgraph_l`](./reference/ismbcgraph-functions.md) | Graphic | Returns nonzero if and only if `c` is a single-byte representation of any ASCII or katakana printable character except a white space ( ). See examples for `_ismbcdigit`, `_ismbcalpha`, and `_ismbcpunct`. |
-| [`_ismbclegal`, `_ismbclegal_l`](./reference/ismbclegal-ismbclegal-l-ismbcsymbol-ismbcsymbol-l.md) | Valid multibyte character | Returns nonzero if and only if the first byte of `c` is within ranges 0x81 - 0x9F or 0xE0 - 0xFC, while the second byte is within ranges 0x40 - 0x7E or 0x80 - FC. |
-| [`_ismbclower`, `_ismbclower_l`](./reference/ismbclower-ismbclower-l-ismbcupper-ismbcupper-l.md) | Lowercase alphabetic | Returns nonzero if and only if `c` is a single-byte representation of an ASCII lowercase English letter: 0x61<=`c`<=0x7A. |
-| [`_ismbcprint`, `_ismbcprint_l`](./reference/ismbcgraph-functions.md) | Printable | Returns nonzero if and only if `c` is a single-byte representation of any ASCII or katakana printable character including a white space ( ): See examples for `_ismbcspace`, `_ismbcdigit`, `_ismbcalpha`, and `_ismbcpunct`. |
-| [`_ismbcpunct`, `_ismbcpunct_l`](./reference/ismbcgraph-functions.md) | Punctuation | Returns nonzero if and only if `c` is a single-byte representation of any ASCII or katakana punctuation character. |
-| [`_ismbcblank`, `_ismbcblank_l`](./reference/ismbcgraph-functions.md) | Space or horizontal tab | Returns nonzero if and only if `c` is a single-byte representation of a space character or a horizontal tab character: `c`=0x20 or `c`=0x09. |
-| [`_ismbcspace`, `_ismbcspace_l`](./reference/ismbcgraph-functions.md) | Whitespace | Returns nonzero if and only if `c` is a white space character: `c`=0x20 or 0x09<=`c`<=0x0D. |
-| [`_ismbcsymbol`, `_ismbcsymbol_l`](./reference/ismbclegal-ismbclegal-l-ismbcsymbol-ismbcsymbol-l.md) | Multibyte symbol | Returns nonzero if and only if 0x8141<=`c`<=0x81AC. |
-| [`_ismbcupper`, `_ismbcupper_l`](./reference/ismbclower-ismbclower-l-ismbcupper-ismbcupper-l.md) | Uppercase alphabetic | Returns nonzero if and only if `c` is a single-byte representation of an ASCII uppercase English letter: 0x41<=`c`<=0x5A. |
+| [`_ismbcalnum`, `_ismbcalnum_l`](reference/ismbcalnum-functions.md) | Alphanumeric | Returns nonzero if and only if `c` is a single-byte representation of an ASCII English letter: See examples for `_ismbcdigit` and `_ismbcalpha`. |
+| [`_ismbcalpha`, `_ismbcalpha_l`](reference/ismbcalnum-functions.md) | Alphabetic | Returns nonzero if and only if `c` is a single-byte representation of an ASCII English letter: See examples for `_ismbcupper` and `_ismbclower`; or a katakana letter: 0xA6<=`c`<=0xDF. |
+| [`_ismbcdigit`, `_ismbcdigit_l`](reference/ismbcalnum-functions.md) | Digit | Returns nonzero if and only if `c` is a single-byte representation of an ASCII digit: 0x30<=`c`<=0x39. |
+| [`_ismbcgraph`, `_ismbcgraph_l`](reference/ismbcgraph-functions.md) | Graphic | Returns nonzero if and only if `c` is a single-byte representation of any ASCII or katakana printable character except a white space ( ). See examples for `_ismbcdigit`, `_ismbcalpha`, and `_ismbcpunct`. |
+| [`_ismbclegal`, `_ismbclegal_l`](reference/ismbclegal-ismbclegal-l-ismbcsymbol-ismbcsymbol-l.md) | Valid multibyte character | Returns nonzero if and only if the first byte of `c` is within ranges 0x81 - 0x9F or 0xE0 - 0xFC, while the second byte is within ranges 0x40 - 0x7E or 0x80 - FC. |
+| [`_ismbclower`, `_ismbclower_l`](reference/ismbclower-ismbclower-l-ismbcupper-ismbcupper-l.md) | Lowercase alphabetic | Returns nonzero if and only if `c` is a single-byte representation of an ASCII lowercase English letter: 0x61<=`c`<=0x7A. |
+| [`_ismbcprint`, `_ismbcprint_l`](reference/ismbcgraph-functions.md) | Printable | Returns nonzero if and only if `c` is a single-byte representation of any ASCII or katakana printable character including a white space ( ): See examples for `_ismbcspace`, `_ismbcdigit`, `_ismbcalpha`, and `_ismbcpunct`. |
+| [`_ismbcpunct`, `_ismbcpunct_l`](reference/ismbcgraph-functions.md) | Punctuation | Returns nonzero if and only if `c` is a single-byte representation of any ASCII or katakana punctuation character. |
+| [`_ismbcblank`, `_ismbcblank_l`](reference/ismbcgraph-functions.md) | Space or horizontal tab | Returns nonzero if and only if `c` is a single-byte representation of a space character or a horizontal tab character: `c`=0x20 or `c`=0x09. |
+| [`_ismbcspace`, `_ismbcspace_l`](reference/ismbcgraph-functions.md) | Whitespace | Returns nonzero if and only if `c` is a white space character: `c`=0x20 or 0x09<=`c`<=0x0D. |
+| [`_ismbcsymbol`, `_ismbcsymbol_l`](reference/ismbclegal-ismbclegal-l-ismbcsymbol-ismbcsymbol-l.md) | Multibyte symbol | Returns nonzero if and only if 0x8141<=`c`<=0x81AC. |
+| [`_ismbcupper`, `_ismbcupper_l`](reference/ismbclower-ismbclower-l-ismbcupper-ismbcupper-l.md) | Uppercase alphabetic | Returns nonzero if and only if `c` is a single-byte representation of an ASCII uppercase English letter: 0x41<=`c`<=0x5A. |
**Code Page 932 Specific**
@@ -43,18 +42,18 @@ The following routines are specific to code page 932.
| Routine | Test condition (code page 932 only) |
|---|---|
-| [`_ismbchira`, `_ismbchira_l`](./reference/ismbchira-ismbchira-l-ismbckata-ismbckata-l.md) | Double-byte Hiragana: 0x829F<=`c`<=0x82F1. |
-| [`_ismbckata`, `_ismbckata_l`](./reference/ismbchira-ismbchira-l-ismbckata-ismbckata-l.md) | Double-byte katakana: 0x8340<=`c`<=0x8396. |
-| [`_ismbcl0`, `_ismbcl0_l`](./reference/ismbcl0-ismbcl0-l-ismbcl1-ismbcl1-l-ismbcl2-ismbcl2-l.md) | JIS non-Kanji: 0x8140<=`c`<=0x889E. |
-| [`_ismbcl1`, `_ismbcl1_l`](./reference/ismbcl0-ismbcl0-l-ismbcl1-ismbcl1-l-ismbcl2-ismbcl2-l.md) | JIS level-1: 0x889F<=`c`<=0x9872. |
-| [`_ismbcl2`, `_ismbcl2_l`](./reference/ismbcl0-ismbcl0-l-ismbcl1-ismbcl1-l-ismbcl2-ismbcl2-l.md) | JIS level-2: 0x989F<=`c`<=0xEA9E. |
+| [`_ismbchira`, `_ismbchira_l`](reference/ismbchira-ismbchira-l-ismbckata-ismbckata-l.md) | Double-byte Hiragana: 0x829F<=`c`<=0x82F1. |
+| [`_ismbckata`, `_ismbckata_l`](reference/ismbchira-ismbchira-l-ismbckata-ismbckata-l.md) | Double-byte katakana: 0x8340<=`c`<=0x8396. |
+| [`_ismbcl0`, `_ismbcl0_l`](reference/ismbcl0-ismbcl0-l-ismbcl1-ismbcl1-l-ismbcl2-ismbcl2-l.md) | JIS non-Kanji: 0x8140<=`c`<=0x889E. |
+| [`_ismbcl1`, `_ismbcl1_l`](reference/ismbcl0-ismbcl0-l-ismbcl1-ismbcl1-l-ismbcl2-ismbcl2-l.md) | JIS level-1: 0x889F<=`c`<=0x9872. |
+| [`_ismbcl2`, `_ismbcl2_l`](reference/ismbcl0-ismbcl0-l-ismbcl1-ismbcl1-l-ismbcl2-ismbcl2-l.md) | JIS level-2: 0x989F<=`c`<=0xEA9E. |
-`_ismbcl0`, `_ismbcl1`, and `_ismbcl2` check that the specified value `c` matches the test conditions described in the preceding table, but don't check that `c` is a valid multibyte character. If the lower byte is in the ranges 0x00 - 0x3F, 0x7F, or 0xFD - 0xFF, these functions return a nonzero value, indicating that the character satisfies the test condition. Use [`_ismbbtrail`, `_ismbbtrail_l`](./reference/ismbbtrail-ismbbtrail-l.md) to test whether the multibyte character is defined.
+`_ismbcl0`, `_ismbcl1`, and `_ismbcl2` check that the specified value `c` matches the test conditions described in the preceding table, but don't check that `c` is a valid multibyte character. If the lower byte is in the ranges 0x00 - 0x3F, 0x7F, or 0xFD - 0xFF, these functions return a nonzero value, indicating that the character satisfies the test condition. Use [`_ismbbtrail`, `_ismbbtrail_l`](reference/ismbbtrail-ismbbtrail-l.md) to test whether the multibyte character is defined.
**END Code Page 932 Specific**
## See also
-[Character classification](./character-classification.md)\
-[`is`, `isw` routines](./is-isw-routines.md)\
-[`_ismbb` routines](./ismbb-routines.md)
+[Character classification](character-classification.md)\
+[`is`, `isw` routines](is-isw-routines.md)\
+[`_ismbb` routines](ismbb-routines.md)
diff --git a/docs/c-runtime-library/language-strings.md b/docs/c-runtime-library/language-strings.md
index c68c721c29..99b9af3a15 100644
--- a/docs/c-runtime-library/language-strings.md
+++ b/docs/c-runtime-library/language-strings.md
@@ -6,7 +6,7 @@ helpviewer_keywords: ["language strings"]
---
# Language strings
-The [`setlocale`](./reference/setlocale-wsetlocale.md) and [`_create_locale`](./reference/create-locale-wcreate-locale.md) functions can use the Windows NLS API supported languages on operating systems that don't use the Unicode code page. For a list of supported languages by operating system version, see [Appendix A: Product Behavior](/openspecs/windows_protocols/ms-lcid/a9eac961-e77d-41a6-90a5-ce1a8b0cdb9c) in \[MS-LCID]: Windows Language Code Identifier (LCID) Reference. The language string can be any of the values in the **Language** and **Language tag** columns of the list of supported languages. For example code that enumerates available locale names and related values, see [NLS: Name-based APIs Sample](/windows/win32/intl/nls--name-based-apis-sample).
+The [`setlocale`](reference/setlocale-wsetlocale.md) and [`_create_locale`](reference/create-locale-wcreate-locale.md) functions can use the Windows NLS API supported languages on operating systems that don't use the Unicode code page. For a list of supported languages by operating system version, see [Appendix A: Product Behavior](/openspecs/windows_protocols/ms-lcid/a9eac961-e77d-41a6-90a5-ce1a8b0cdb9c) in \[MS-LCID]: Windows Language Code Identifier (LCID) Reference. The language string can be any of the values in the **Language** and **Language tag** columns of the list of supported languages. For example code that enumerates available locale names and related values, see [NLS: Name-based APIs Sample](/windows/win32/intl/nls--name-based-apis-sample).
## Supported language strings
@@ -82,7 +82,7 @@ The Microsoft C run-time library implementation also supports these language str
## See also
-- [Locale names, Languages, and Country/Region strings](./locale-names-languages-and-country-region-strings.md)\
-- [Country/Region strings](./country-region-strings.md)\
-- [`setlocale`, `_wsetlocale`](./reference/setlocale-wsetlocale.md)\
-- [`_create_locale`, `_wcreate_locale`](./reference/create-locale-wcreate-locale.md)
+- [Locale names, Languages, and Country/Region strings](locale-names-languages-and-country-region-strings.md)
+- [Country/Region strings](country-region-strings.md)
+- [`setlocale`, `_wsetlocale`](reference/setlocale-wsetlocale.md)
+- [`_create_locale`, `_wcreate_locale`](reference/create-locale-wcreate-locale.md)
diff --git a/docs/c-runtime-library/link-options.md b/docs/c-runtime-library/link-options.md
index 33a73b92de..7f27f9a178 100644
--- a/docs/c-runtime-library/link-options.md
+++ b/docs/c-runtime-library/link-options.md
@@ -1,27 +1,26 @@
---
-description: "Learn more about: Link Options"
-title: "Link Options"
+title: "Link options"
+description: "Learn more about: Link options"
ms.date: "11/04/2016"
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"]
-ms.assetid: 05b5a77b-9dd1-494b-ae46-314598c770bb
---
# Link options
-The CRT lib directory includes several small object files that enable specific CRT features without any code change. These object files are called "link options" since you only have to add them to the linker command line to use them.
+The CRT lib directory includes several small object files that enable specific CRT features without code changes. These object files are called "link options" because you only have to add them to the linker command line to use them. To do this from Visual Studio, in the Solution Explorer right-click your project and choose **Properties**. Under **Configuration Properties**, choose **Linker** > **Input** > **Additional Dependencies** and specify the additional items to add to the link command line.
-CLR pure mode versions of these objects are deprecated in Visual Studio 2015 and unsupported in Visual Studio 2017. Use the regular versions for native and /clr code.
+CLR pure mode versions of these objects are deprecated in Visual Studio 2015 and unsupported in Visual Studio 2017. Use the regular versions for native and [`/clr`](../build/reference/clr-common-language-runtime-compilation.md) code.
| Native and /clr | Pure mode | Description |
|---|---|---|
-| `binmode.obj` | `pbinmode.obj` | Sets the default file-translation mode to binary. See [`_fmode`](./fmode.md). |
+| `binmode.obj` | `pbinmode.obj` | Sets the default file-translation mode to binary. See [`_fmode`](fmode.md). |
| `chkstk.obj` | n/a | Provides stack-checking and alloca support when not using the CRT. |
-| `commode.obj` | `pcommode.obj` | Sets the global commit flag to "commit". See [`fopen`, `_wfopen`](./reference/fopen-wfopen.md) and [`fopen_s`, `_wfopen_s`](./reference/fopen-s-wfopen-s.md). |
-| 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, don't use it for DLLs. Linking to this file is equivalent to including `combase.h` and defining `_EXE_INITIALIZE_MTA`. Using this link option adds [onecore.lib](/windows/win32/apiindex/windows-umbrella-libraries) to the default library list. If this effect is undesirable (such as using onecore_apiset.lib or other umbrella library), use [/NODEFAULTLIB](../build/reference/nodefaultlib-ignore-libraries.md) to override this behavior and provide an alternative. |
-| `fp10.obj` | n/a | Changes the default precision control to 64 bits. See [Math and floating-point support](./floating-point-support.md). |
+| `commode.obj` | `pcommode.obj` | Sets the global commit flag to "commit". See [`fopen`, `_wfopen`](reference/fopen-wfopen.md) and [`fopen_s`, `_wfopen_s`](reference/fopen-s-wfopen-s.md). |
+| `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, don't use it for DLLs. Linking to this file is equivalent to including `combase.h` and defining `_EXE_INITIALIZE_MTA`. Using this link option adds [`onecore.lib`](/windows/win32/apiindex/windows-umbrella-libraries) to the default library list. If this effect is undesirable (such as using onecore_apiset.lib or other umbrella library), use [`/NODEFAULTLIB`](../build/reference/nodefaultlib-ignore-libraries.md) to override this behavior and provide an alternative. |
+| `fp10.obj` | n/a | Changes the default precision control to 64 bits. See [Math and floating-point support](floating-point-support.md). |
| `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. |
-| `legacy_stdio_float_rounding.obj` | n/a | The printing of floating-point values (for example, when using [`printf`](./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 [`fesetround`](./reference/fegetround-fesetround2.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. |
+| `legacy_stdio_float_rounding.obj` | n/a | The printing of floating-point values (for example, when using [`printf`](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 [`fesetround`](reference/fegetround-fesetround2.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. |
| `loosefpmath.obj` | n/a | Ensures that floating point code tolerates denormal values. |
-| `newmode.obj` | `pnewmode.obj` | Causes [`malloc`](./reference/malloc.md) to call the new handler on failure. See [`_set_new_mode`](./reference/set-new-mode.md), [`_set_new_handler`](./reference/set-new-handler.md), [`calloc`](./reference/calloc.md), and [`realloc`](./reference/realloc.md). |
+| `newmode.obj` | `pnewmode.obj` | Causes [`malloc`](reference/malloc.md) to call the new handler on failure. See [`_set_new_mode`](reference/set-new-mode.md), [`_set_new_handler`](reference/set-new-handler.md), [`calloc`](reference/calloc.md), and [`realloc`](reference/realloc.md). |
| `noarg.obj` | `pnoarg.obj` | Disables all processing of argc and argv. |
| `nochkclr.obj` | n/a | Does nothing. Remove from your project. |
| `noenv.obj` | `pnoenv.obj` | Disables the creation of a cached environment for the CRT. |
@@ -32,4 +31,4 @@ CLR pure mode versions of these objects are deprecated in Visual Studio 2015 and
## See also
-- [C runtime (CRT) and C++ Standard Library (STL) `.lib` files](./crt-library-features.md)
+- [C runtime (CRT) and C++ Standard Library (STL) `.lib` files](crt-library-features.md)
diff --git a/docs/c-runtime-library/locale.md b/docs/c-runtime-library/locale.md
index f7ced3c342..5801ca774e 100644
--- a/docs/c-runtime-library/locale.md
+++ b/docs/c-runtime-library/locale.md
@@ -1,63 +1,63 @@
---
-description: "Learn more about: Locale"
title: "Locale"
-ms.date: "04/11/2018"
+description: "Learn more about: Locale"
+ms.date: 04/11/2018
f1_keywords: ["c.international"]
helpviewer_keywords: ["localization, locale", "country/region information", "language information routines", "setlocale function", "locale routines"]
---
# Locale
-*Locale* refers to country/region and language settings that you can use to customize your program. Some locale-dependent categories include the display formats for dates and monetary values. For more information, see [Locale categories](./locale-categories.md).
+*Locale* refers to country/region and language settings that you can use to customize your program. Some locale-dependent categories include the display formats for dates and monetary values. For more information, see [Locale categories](locale-categories.md).
-Use the [`setlocale`](./reference/setlocale-wsetlocale.md) function to change or query some or all of the current program or thread locale information while using functions without the **`_l`** suffix. The functions with the **`_l`** suffix will use the locale parameter passed in for their locale information during the execution of that specific function only. To create a locale for use with a function with a **`_l`** suffix, use [`_create_locale`](./reference/create-locale-wcreate-locale.md). To free this locale, use [`_free_locale`](./reference/free-locale.md). To get the current locale, use [`_get_current_locale`](./reference/get-current-locale.md).
+Use the [`setlocale`](reference/setlocale-wsetlocale.md) function to change or query some or all of the current program or thread locale information while using functions without the **`_l`** suffix. The functions with the **`_l`** suffix will use the locale parameter passed in for their locale information during the execution of that specific function only. To create a locale for use with a function with a **`_l`** suffix, use [`_create_locale`](reference/create-locale-wcreate-locale.md). To free this locale, use [`_free_locale`](reference/free-locale.md). To get the current locale, use [`_get_current_locale`](reference/get-current-locale.md).
-Use [`_configthreadlocale`](./reference/configthreadlocale.md) to control whether each thread has its own locale, or all threads in a program share the same locale. For more information, see [Locales and code pages](../text/locales-and-code-pages.md).
+Use [`_configthreadlocale`](reference/configthreadlocale.md) to control whether each thread has its own locale, or all threads in a program share the same locale. For more information, see [Locales and code pages](../text/locales-and-code-pages.md).
-More secure versions of the functions in the following table are available, indicated by the **`_s`** ("secure") suffix. For more information, see [Security features in the CRT](./security-features-in-the-crt.md).
+More secure versions of the functions in the following table are available, indicated by the **`_s`** ("secure") suffix. For more information, see [Security features in the CRT](security-features-in-the-crt.md).
## Locale-dependent routines
| Routine | Use | **`setlocale`** category setting dependence |
|---|---|---|
-| [`atof`, `_atof_l`, `_wtof`, `_wtof_l`](./reference/atof-atof-l-wtof-wtof-l.md) | Convert character to floating-point value | `LC_NUMERIC` |
-| [`atoi`, `_atoi_l`, `_wtoi`, `_wtoi_l`](./reference/atoi-atoi-l-wtoi-wtoi-l.md) | Convert character to integer value | `LC_NUMERIC` |
-| [`_atoi64`, `_atoi64_l`, `_wtoi64`, `_wtoi64_l`](./reference/atoi64-atoi64-l-wtoi64-wtoi64-l.md) | Convert character to 64-bit integer value | `LC_NUMERIC` |
-| [`atol`, `_atol_l`, `_wtol`, `_wtol_l`](./reference/atol-atol-l-wtol-wtol-l.md) | Convert character to long value | `LC_NUMERIC` |
-| [`_atodbl`, `_atodbl_l`, `_atoldbl`, `_atoldbl_l`, `_atoflt`, `_atoflt_l`](./reference/atodbl-atodbl-l-atoldbl-atoldbl-l-atoflt-atoflt-l.md) | Convert character to double-long value | `LC_NUMERIC` |
-| [`is`, `isw` routines](./is-isw-routines.md) | Test given integer for particular condition. | `LC_CTYPE` |
-| [`isleadbyte`, `_isleadbyte_l`](./reference/isleadbyte-isleadbyte-l.md) | Test for lead byte | `LC_CTYPE` |
-| [`localeconv`](./reference/localeconv.md) | Read appropriate values for formatting numeric quantities | `LC_MONETARY, LC_NUMERIC` |
-| [`MB_CUR_MAX`](./mb-cur-max.md) | Maximum length in bytes of any multibyte character in current locale (macro defined in `STDLIB.H`) | `LC_CTYPE` |
-| [`_mbccpy`, `_mbccpy_l`](./reference/mbccpy-mbccpy-l.md),[`_mbccpy_s`, `_mbccpy_s_l`](./reference/mbccpy-s-mbccpy-s-l.md) | Copy one multibyte character | `LC_CTYPE` |
-| [`_mbclen`, `mblen`, `_mblen_l`](./reference/mbclen-mblen-mblen-l.md) | Validate and return number of bytes in multibyte character | `LC_CTYPE` |
-| [`strlen`, `wcslen`, `_mbslen`, `_mbslen_l`, `_mbstrlen`, `_mbstrlen_l`](./reference/strlen-wcslen-mbslen-mbslen-l-mbstrlen-mbstrlen-l.md) | For multibyte-character strings: validate each character in string; return string length | `LC_CTYPE` |
-| [`mbstowcs`, `_mbstowcs_l`](./reference/mbstowcs-mbstowcs-l.md),[`mbstowcs_s`, `_mbstowcs_s_l`](./reference/mbstowcs-s-mbstowcs-s-l.md) | Convert sequence of multibyte characters to corresponding sequence of wide characters | `LC_CTYPE` |
-| [`mbtowc`, `_mbtowc_l`](./reference/mbtowc-mbtowc-l.md) | Convert multibyte character to corresponding wide character | `LC_CTYPE` |
-| [`printf`](./reference/printf-printf-l-wprintf-wprintf-l.md) functions | Write formatted output | `LC_NUMERIC` (determines radix character output) |
-| [`scanf`](./reference/scanf-scanf-l-wscanf-wscanf-l.md) functions | Read formatted input | `LC_NUMERIC` (determines radix character recognition) |
-| [`setlocale`, `_wsetlocale`](./reference/setlocale-wsetlocale.md) | Select locale for program | Not applicable |
-| [`strcoll`, `wcscoll`, `_mbscoll`, `_strcoll_l`, `_wcscoll_l`, `_mbscoll_l`](./reference/strcoll-wcscoll-mbscoll-strcoll-l-wcscoll-l-mbscoll-l.md) | Compare characters of two strings | `LC_COLLATE` |
-| [`_stricmp`, `_wcsicmp`, `_mbsicmp`, `_stricmp_l`, `_wcsicmp_l`, `_mbsicmp_l`](./reference/stricmp-wcsicmp-mbsicmp-stricmp-l-wcsicmp-l-mbsicmp-l.md) | Compare two strings without regard to case | `LC_CTYPE` |
-| [`_stricoll`, `_wcsicoll`, `_mbsicoll`, `_stricoll_l`, `_wcsicoll_l`, `_mbsicoll_l`](./reference/stricoll-wcsicoll-mbsicoll-stricoll-l-wcsicoll-l-mbsicoll-l.md) | Compare characters of two strings (case insensitive) | `LC_COLLATE` |
-| [`_strncoll`, `_wcsncoll`, `_mbsncoll`, `_strncoll_l`, `_wcsncoll_l`, `_mbsncoll_l`](./reference/strncoll-wcsncoll-mbsncoll-strncoll-l-wcsncoll-l-mbsncoll-l.md) | Compare first **`n`** characters of two strings | `LC_COLLATE` |
-| [`_strnicmp`, `_wcsnicmp`, `_mbsnicmp`, `_strnicmp_l`, `_wcsnicmp_l`, `_mbsnicmp_l`](./reference/strnicmp-wcsnicmp-mbsnicmp-strnicmp-l-wcsnicmp-l-mbsnicmp-l.md) | Compare characters of two strings without regard to case. | `LC_CTYPE` |
-| [`_strnicoll`, `_wcsnicoll`, `_mbsnicoll`, `_strnicoll_l`, `_wcsnicoll_l`, `_mbsnicoll_l`](./reference/strnicoll-wcsnicoll-mbsnicoll-strnicoll-l-wcsnicoll-l-mbsnicoll-l.md) | Compare first **`n`** characters of two strings (case insensitive) | `LC_COLLATE` |
-| [`strftime`, `wcsftime`, `_strftime_l`, `_wcsftime_l`](./reference/strftime-wcsftime-strftime-l-wcsftime-l.md) | Format date and time value according to supplied **`format`** argument | `LC_TIME` |
-| [`_strlwr`, `_wcslwr`, `_mbslwr`, `_strlwr_l`, `_wcslwr_l`, `_mbslwr_l`](./reference/strlwr-wcslwr-mbslwr-strlwr-l-wcslwr-l-mbslwr-l.md),[`_strlwr_s`, `_strlwr_s_l`, `_mbslwr_s`, `_mbslwr_s_l`, `_wcslwr_s`, `_wcslwr_s_l`](./reference/strlwr-s-strlwr-s-l-mbslwr-s-mbslwr-s-l-wcslwr-s-wcslwr-s-l.md) | Convert, in place, each uppercase letter in given string to lowercase | `LC_CTYPE` |
-| [`strtod`, `_strtod_l`, `wcstod`, `_wcstod_l`](./reference/strtod-strtod-l-wcstod-wcstod-l.md) | Convert character string to **`double`** value | `LC_NUMERIC` (determines radix character recognition) |
-| [`strtol`, `wcstol`, `_strtol_l`, `_wcstol_l`](./reference/strtol-wcstol-strtol-l-wcstol-l.md) | Convert character string to **`long`** value | `LC_NUMERIC` (determines radix character recognition) |
-| [`strtoul`, `_strtoul_l`, `wcstoul`, `_wcstoul_l`](./reference/strtoul-strtoul-l-wcstoul-wcstoul-l.md) | Convert character string to unsigned long value | `LC_NUMERIC` (determines radix character recognition) |
-| [`_strupr`, `_strupr_l`, `_mbsupr`, `_mbsupr_l`, `_wcsupr_l`, `_wcsupr`](./reference/strupr-strupr-l-mbsupr-mbsupr-l-wcsupr-l-wcsupr.md),[`_strupr_s`, `_strupr_s_l`, `_mbsupr_s`, `_mbsupr_s_l`, `_wcsupr_s`, `_wcsupr_s_l`](./reference/strupr-s-strupr-s-l-mbsupr-s-mbsupr-s-l-wcsupr-s-wcsupr-s-l.md) | Convert, in place, each lowercase letter in string to uppercase | `LC_CTYPE` |
-| [`strxfrm`, `wcsxfrm`, `_strxfrm_l`, `_wcsxfrm_l`](./reference/strxfrm-wcsxfrm-strxfrm-l-wcsxfrm-l.md) | Transform string into collated form according to locale | `LC_COLLATE` |
-| [`tolower`, `_tolower`, `towlower`, `_tolower_l`, `_towlower_l`](./reference/tolower-tolower-towlower-tolower-l-towlower-l.md),[`_mbctolower`, `_mbctolower_l`, `_mbctoupper`, `_mbctoupper_l`](./reference/mbctolower-mbctolower-l-mbctoupper-mbctoupper-l.md) | Convert given character to corresponding lowercase character | `LC_CTYPE` |
-| [`toupper`, `_toupper`, `towupper`, `_toupper_l`, `_towupper_l`](./reference/toupper-toupper-towupper-toupper-l-towupper-l.md),[`_mbctolower`, `_mbctolower_l`, `_mbctoupper`, `_mbctoupper_l`](./reference/mbctolower-mbctolower-l-mbctoupper-mbctoupper-l.md) | Convert given character to corresponding uppercase letter | `LC_CTYPE` |
-| [`wcstombs`, `_wcstombs_l`](./reference/wcstombs-wcstombs-l.md),[`wcstombs_s`, `_wcstombs_s_l`](./reference/wcstombs-s-wcstombs-s-l.md) | Convert sequence of wide characters to corresponding sequence of multibyte characters | `LC_CTYPE` |
-| [`wctomb`, `_wctomb_l`](./reference/wctomb-wctomb-l.md),[`wctomb_s`, `_wctomb_s_l`](./reference/wctomb-s-wctomb-s-l.md) | Convert wide character to corresponding multibyte character | `LC_CTYPE` |
+| [`atof`, `_atof_l`, `_wtof`, `_wtof_l`](reference/atof-atof-l-wtof-wtof-l.md) | Convert character to floating-point value | `LC_NUMERIC` |
+| [`atoi`, `_atoi_l`, `_wtoi`, `_wtoi_l`](reference/atoi-atoi-l-wtoi-wtoi-l.md) | Convert character to integer value | `LC_NUMERIC` |
+| [`_atoi64`, `_atoi64_l`, `_wtoi64`, `_wtoi64_l`](reference/atoi64-atoi64-l-wtoi64-wtoi64-l.md) | Convert character to 64-bit integer value | `LC_NUMERIC` |
+| [`atol`, `_atol_l`, `_wtol`, `_wtol_l`](reference/atol-atol-l-wtol-wtol-l.md) | Convert character to long value | `LC_NUMERIC` |
+| [`_atodbl`, `_atodbl_l`, `_atoldbl`, `_atoldbl_l`, `_atoflt`, `_atoflt_l`](reference/atodbl-atodbl-l-atoldbl-atoldbl-l-atoflt-atoflt-l.md) | Convert character to double-long value | `LC_NUMERIC` |
+| [`is`, `isw` routines](is-isw-routines.md) | Test given integer for particular condition. | `LC_CTYPE` |
+| [`isleadbyte`, `_isleadbyte_l`](reference/isleadbyte-isleadbyte-l.md) | Test for lead byte | `LC_CTYPE` |
+| [`localeconv`](reference/localeconv.md) | Read appropriate values for formatting numeric quantities | `LC_MONETARY, LC_NUMERIC` |
+| [`MB_CUR_MAX`](mb-cur-max.md) | Maximum length in bytes of any multibyte character in current locale (macro defined in `STDLIB.H`) | `LC_CTYPE` |
+| [`_mbccpy`, `_mbccpy_l`](reference/mbccpy-mbccpy-l.md), [`_mbccpy_s`, `_mbccpy_s_l`](reference/mbccpy-s-mbccpy-s-l.md) | Copy one multibyte character | `LC_CTYPE` |
+| [`_mbclen`, `mblen`, `_mblen_l`](reference/mbclen-mblen-mblen-l.md) | Validate and return number of bytes in multibyte character | `LC_CTYPE` |
+| [`strlen`, `wcslen`, `_mbslen`, `_mbslen_l`, `_mbstrlen`, `_mbstrlen_l`](reference/strlen-wcslen-mbslen-mbslen-l-mbstrlen-mbstrlen-l.md) | For multibyte-character strings: validate each character in string; return string length | `LC_CTYPE` |
+| [`mbstowcs`, `_mbstowcs_l`](reference/mbstowcs-mbstowcs-l.md), [`mbstowcs_s`, `_mbstowcs_s_l`](reference/mbstowcs-s-mbstowcs-s-l.md) | Convert sequence of multibyte characters to corresponding sequence of wide characters | `LC_CTYPE` |
+| [`mbtowc`, `_mbtowc_l`](reference/mbtowc-mbtowc-l.md) | Convert multibyte character to corresponding wide character | `LC_CTYPE` |
+| [`printf`](reference/printf-printf-l-wprintf-wprintf-l.md) functions | Write formatted output | `LC_NUMERIC` (determines radix character output) |
+| [`scanf`](reference/scanf-scanf-l-wscanf-wscanf-l.md) functions | Read formatted input | `LC_NUMERIC` (determines radix character recognition) |
+| [`setlocale`, `_wsetlocale`](reference/setlocale-wsetlocale.md) | Select locale for program | Not applicable |
+| [`strcoll`, `wcscoll`, `_mbscoll`, `_strcoll_l`, `_wcscoll_l`, `_mbscoll_l`](reference/strcoll-wcscoll-mbscoll-strcoll-l-wcscoll-l-mbscoll-l.md) | Compare characters of two strings | `LC_COLLATE` |
+| [`_stricmp`, `_wcsicmp`, `_mbsicmp`, `_stricmp_l`, `_wcsicmp_l`, `_mbsicmp_l`](reference/stricmp-wcsicmp-mbsicmp-stricmp-l-wcsicmp-l-mbsicmp-l.md) | Compare two strings without regard to case | `LC_CTYPE` |
+| [`_stricoll`, `_wcsicoll`, `_mbsicoll`, `_stricoll_l`, `_wcsicoll_l`, `_mbsicoll_l`](reference/stricoll-wcsicoll-mbsicoll-stricoll-l-wcsicoll-l-mbsicoll-l.md) | Compare characters of two strings (case insensitive) | `LC_COLLATE` |
+| [`_strncoll`, `_wcsncoll`, `_mbsncoll`, `_strncoll_l`, `_wcsncoll_l`, `_mbsncoll_l`](reference/strncoll-wcsncoll-mbsncoll-strncoll-l-wcsncoll-l-mbsncoll-l.md) | Compare first **`n`** characters of two strings | `LC_COLLATE` |
+| [`_strnicmp`, `_wcsnicmp`, `_mbsnicmp`, `_strnicmp_l`, `_wcsnicmp_l`, `_mbsnicmp_l`](reference/strnicmp-wcsnicmp-mbsnicmp-strnicmp-l-wcsnicmp-l-mbsnicmp-l.md) | Compare characters of two strings without regard to case. | `LC_CTYPE` |
+| [`_strnicoll`, `_wcsnicoll`, `_mbsnicoll`, `_strnicoll_l`, `_wcsnicoll_l`, `_mbsnicoll_l`](reference/strnicoll-wcsnicoll-mbsnicoll-strnicoll-l-wcsnicoll-l-mbsnicoll-l.md) | Compare first **`n`** characters of two strings (case insensitive) | `LC_COLLATE` |
+| [`strftime`, `wcsftime`, `_strftime_l`, `_wcsftime_l`](reference/strftime-wcsftime-strftime-l-wcsftime-l.md) | Format date and time value according to supplied **`format`** argument | `LC_TIME` |
+| [`_strlwr`, `_wcslwr`, `_mbslwr`, `_strlwr_l`, `_wcslwr_l`, `_mbslwr_l`](reference/strlwr-wcslwr-mbslwr-strlwr-l-wcslwr-l-mbslwr-l.md), [`_strlwr_s`, `_strlwr_s_l`, `_mbslwr_s`, `_mbslwr_s_l`, `_wcslwr_s`, `_wcslwr_s_l`](reference/strlwr-s-strlwr-s-l-mbslwr-s-mbslwr-s-l-wcslwr-s-wcslwr-s-l.md) | Convert, in place, each uppercase letter in given string to lowercase | `LC_CTYPE` |
+| [`strtod`, `_strtod_l`, `wcstod`, `_wcstod_l`](reference/strtod-strtod-l-wcstod-wcstod-l.md) | Convert character string to **`double`** value | `LC_NUMERIC` (determines radix character recognition) |
+| [`strtol`, `wcstol`, `_strtol_l`, `_wcstol_l`](reference/strtol-wcstol-strtol-l-wcstol-l.md) | Convert character string to **`long`** value | `LC_NUMERIC` (determines radix character recognition) |
+| [`strtoul`, `_strtoul_l`, `wcstoul`, `_wcstoul_l`](reference/strtoul-strtoul-l-wcstoul-wcstoul-l.md) | Convert character string to unsigned long value | `LC_NUMERIC` (determines radix character recognition) |
+| [`_strupr`, `_strupr_l`, `_mbsupr`, `_mbsupr_l`, `_wcsupr_l`, `_wcsupr`](reference/strupr-strupr-l-mbsupr-mbsupr-l-wcsupr-l-wcsupr.md), [`_strupr_s`, `_strupr_s_l`, `_mbsupr_s`, `_mbsupr_s_l`, `_wcsupr_s`, `_wcsupr_s_l`](reference/strupr-s-strupr-s-l-mbsupr-s-mbsupr-s-l-wcsupr-s-wcsupr-s-l.md) | Convert, in place, each lowercase letter in string to uppercase | `LC_CTYPE` |
+| [`strxfrm`, `wcsxfrm`, `_strxfrm_l`, `_wcsxfrm_l`](reference/strxfrm-wcsxfrm-strxfrm-l-wcsxfrm-l.md) | Transform string into collated form according to locale | `LC_COLLATE` |
+| [`tolower`, `_tolower`, `towlower`, `_tolower_l`, `_towlower_l`](reference/tolower-tolower-towlower-tolower-l-towlower-l.md), [`_mbctolower`, `_mbctolower_l`, `_mbctoupper`, `_mbctoupper_l`](reference/mbctolower-mbctolower-l-mbctoupper-mbctoupper-l.md) | Convert given character to corresponding lowercase character | `LC_CTYPE` |
+| [`toupper`, `_toupper`, `towupper`, `_toupper_l`, `_towupper_l`](reference/toupper-toupper-towupper-toupper-l-towupper-l.md), [`_mbctolower`, `_mbctolower_l`, `_mbctoupper`, `_mbctoupper_l`](reference/mbctolower-mbctolower-l-mbctoupper-mbctoupper-l.md) | Convert given character to corresponding uppercase letter | `LC_CTYPE` |
+| [`wcstombs`, `_wcstombs_l`](reference/wcstombs-wcstombs-l.md), [`wcstombs_s`, `_wcstombs_s_l`](reference/wcstombs-s-wcstombs-s-l.md) | Convert sequence of wide characters to corresponding sequence of multibyte characters | `LC_CTYPE` |
+| [`wctomb`, `_wctomb_l`](reference/wctomb-wctomb-l.md), [`wctomb_s`, `_wctomb_s_l`](reference/wctomb-s-wctomb-s-l.md) | Convert wide character to corresponding multibyte character | `LC_CTYPE` |
> [!NOTE]
-> For multibyte routines, the multibyte code page must be equivalent to the locale set with [`setlocale`](./reference/setlocale-wsetlocale.md). [`_setmbcp`](./reference/setmbcp.md), with an argument of `_MB_CP_LOCALE` makes the multibyte code page the same as the **`setlocale`** code page.
+> For multibyte routines, the multibyte code page must be equivalent to the locale set with [`setlocale`](reference/setlocale-wsetlocale.md). [`_setmbcp`](reference/setmbcp.md), with an argument of `_MB_CP_LOCALE` makes the multibyte code page the same as the **`setlocale`** code page.
## See also
-[Internationalization](./internationalization.md)\
-[Universal C runtime routines by category](./run-time-routines-by-category.md)
+[Internationalization](internationalization.md)\
+[Universal C runtime routines by category](run-time-routines-by-category.md)
diff --git a/docs/c-runtime-library/lock.md b/docs/c-runtime-library/lock.md
index e9f4e94fa0..19562f13ef 100644
--- a/docs/c-runtime-library/lock.md
+++ b/docs/c-runtime-library/lock.md
@@ -1,14 +1,13 @@
---
-description: "Learn more about: _lock"
title: "_lock"
-ms.date: "11/04/2016"
+description: "Learn more about: _lock"
+ms.date: 11/04/2016
api_name: ["_lock"]
api_location: ["msvcr110_clr0400.dll", "msvcr120.dll", "msvcr100.dll", "msvcr90.dll", "msvcr80.dll", "msvcr110.dll", "msvcrt.dll", "msvcr120_clr0400.dll"]
api_type: ["DLLExport"]
topic_type: ["apiref"]
f1_keywords: ["_lock"]
helpviewer_keywords: ["lock function", "_lock function"]
-ms.assetid: 29f77c37-30de-4b3d-91b6-030216e645a6
---
# `_lock`
@@ -20,7 +19,7 @@ Acquires a multi-thread lock.
## Syntax
```cpp
-void __cdecl _lock
+void __cdecl _lock(
int locknum
);
```
diff --git a/docs/c-runtime-library/reference/abort.md b/docs/c-runtime-library/reference/abort.md
index 991f464049..436a39de91 100644
--- a/docs/c-runtime-library/reference/abort.md
+++ b/docs/c-runtime-library/reference/abort.md
@@ -1,6 +1,6 @@
---
-description: "Learn more about: abort"
title: "abort"
+description: "Learn more about: abort"
ms.date: 07/07/2022
api_name: ["abort", "_o_abort"]
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-ms-win-crt-runtime-l1-1-0.dll"]
@@ -14,7 +14,7 @@ helpviewer_keywords: ["aborting current process", "abort function", "processes,
Aborts the current process and returns an error code.
> [!NOTE]
-> Do not use this method to shut down a Microsoft Store app or Universal Windows Platform (UWP) app, except in testing or debugging scenarios. Programmatic or UI ways to close a Store app are not permitted according to the [Microsoft Store policies](/legal/windows/agreements/store-policies). For more information, see [UWP app lifecycle](/windows/uwp/launch-resume/app-lifecycle).
+> Do not use this method to shut down a Microsoft Store app or Universal Windows Platform (UWP) app, except in testing or debugging scenarios. Programmatic or UI ways to close a Store app are not permitted according to the [Microsoft Store policies](/windows/apps/publish/store-policies). For more information, see [UWP app lifecycle](/windows/uwp/launch-resume/app-lifecycle).
## Syntax
@@ -71,8 +71,8 @@ The following program tries to open a file and aborts if the attempt fails.
// the abort function by attempting to open a file
// and aborts if the attempt fails.
-#include
-#include
+#include
+#include
int main( void )
{
diff --git a/docs/c-runtime-library/reference/access-s-waccess-s.md b/docs/c-runtime-library/reference/access-s-waccess-s.md
index 9aad1accf2..c054b3b97d 100644
--- a/docs/c-runtime-library/reference/access-s-waccess-s.md
+++ b/docs/c-runtime-library/reference/access-s-waccess-s.md
@@ -1,19 +1,19 @@
---
-description: "Learn more about: _access_s, _waccess_s"
-title: "_access_s, _waccess_s"
+description: "Learn more about: _access_s, _waccess_s, _taccess_s"
+title: "_access_s, _waccess_s, _taccess_s"
ms.date: "4/2/2020"
-api_name: ["_access_s", "_waccess_s", "_o__access_s", "_o__waccess_s"]
+api_name: ["_access_s", "_waccess_s", "_taccess_s", "_o__access_s", "_o__waccess_s"]
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-ms-win-crt-filesystem-l1-1-0.dll"]
api_type: ["DLLExport"]
topic_type: ["apiref"]
-f1_keywords: ["waccess_s", "access_s", "_waccess_s", "_access_s", "taccess_s"]
-helpviewer_keywords: ["access_s function", "taccess_s function", "waccess_s function", "_access_s function", "_waccess_s function"]
+f1_keywords: ["waccess_s", "access_s", "_taccess_s"]
+helpviewer_keywords: ["access_s function", "waccess_s function", "_taccess_s function"]
---
-# `_access_s`, `_waccess_s`, `taccess_s`
+# `_access_s`, `_waccess_s`, `_taccess_s`
Determines file read/write permissions. These functions are versions of [`_access`, `_waccess`](access-waccess.md) with security enhancements as described in [Security features in the CRT](../security-features-in-the-crt.md).
-For `taccess_s`, see [Generic-text routine mappings](#generic-text-routine-mappings).
+For `_taccess_s`, see [Generic-text function mappings](#generic-text-function-mappings).
## Syntax
@@ -67,7 +67,7 @@ These functions validate their parameters. If *`path`* is `NULL` or *`mode`* doe
By default, this function's global state is scoped to the application. To change this behavior, see [Global state in the CRT](../global-state.md).
-### Generic-text routine mappings
+### Generic-text function mappings
The function in the `tchar.h` column maps to the function in the other columns depending on the character set that is defined at compile time.
diff --git a/docs/c-runtime-library/reference/access-waccess.md b/docs/c-runtime-library/reference/access-waccess.md
index b6c08cc8bf..87cf212ca0 100644
--- a/docs/c-runtime-library/reference/access-waccess.md
+++ b/docs/c-runtime-library/reference/access-waccess.md
@@ -1,19 +1,20 @@
---
-description: "Learn more about: _access, _waccess"
title: "_access, _waccess"
+description: "Learn more about: _access, _waccess"
ms.date: "4/2/2020"
-api_name: ["_access", "_waccess", "_o__access", "_o__waccess"]
+api_name: ["_access", "_waccess", "t_access", "_o__access", "_o__waccess"]
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-ms-win-crt-filesystem-l1-1-0.dll"]
api_type: ["DLLExport"]
topic_type: ["apiref"]
f1_keywords: ["_waccess", "_access", "taccess", "waccess", "_taccess"]
helpviewer_keywords: ["access function", "_taccess function", "waccess function", "_access function", "_waccess function", "taccess function"]
-ms.assetid: ba34f745-85c3-49e5-a7d4-3590bd249dd3
---
-# `_access`, `_waccess`
+# `_access`, `_waccess`, `t_access`
Determines if a file is read-only or not. More secure versions are available; see [`_access_s`, `_waccess_s`](access-s-waccess-s.md).
+For `_taccess`, see [Generic-text function mappings](#generic-text-function-mappings).
+
## Syntax
```C
@@ -66,7 +67,7 @@ This function validates its parameters. If *`path`* is `NULL` or *`mode`* doesn'
By default, this function's global state is scoped to the application. To change this behavior, see [Global state in the CRT](../global-state.md).
-### Generic-text routine mappings
+### Generic-text function mappings
| `Tchar.h` routine | `_UNICODE` and `_MBCS` not defined | `_MBCS` defined | `_UNICODE` defined |
|---|---|---|---|
@@ -89,9 +90,9 @@ The following example uses **`_access`** to check the file named *`crt_ACCESS.C`
// This example uses _access to check the file named
// crt_ACCESS.C to see if it exists and if writing is allowed.
-#include
-#include
-#include
+#include
+#include
+#include
int main( void )
{
diff --git a/docs/c-runtime-library/reference/and.md b/docs/c-runtime-library/reference/and.md
index 2a5a4412c1..efa2cca286 100644
--- a/docs/c-runtime-library/reference/and.md
+++ b/docs/c-runtime-library/reference/and.md
@@ -1,13 +1,12 @@
---
-description: "Learn more about: and"
title: "and"
+description: "Learn more about: and"
ms.date: "11/04/2016"
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: ["ISO646/and", "and", "std.and", "std::and"]
helpviewer_keywords: ["and macro"]
-ms.assetid: 2644ab57-8e1b-48f0-9021-cafe3e26bdc4
---
# `and`
@@ -16,7 +15,6 @@ An alternative to the && operator.
## Syntax
```C
-
#define and &&
```
diff --git a/docs/c-runtime-library/reference/atanh-atanhf-atanhl.md b/docs/c-runtime-library/reference/atanh-atanhf-atanhl.md
index 02b797f39a..b7ce5af41b 100644
--- a/docs/c-runtime-library/reference/atanh-atanhf-atanhl.md
+++ b/docs/c-runtime-library/reference/atanh-atanhf-atanhl.md
@@ -1,14 +1,13 @@
---
title: "atanh, atanhf, atanhl"
description: "API reference for atanh, atanhf, and atanhl; which calculate the inverse hyperbolic tangent of a floating-point value."
-ms.date: "08/31/2020"
+ms.date: 08/31/2020
api_name: ["atanhl", "atanhf", "atanh", "_o_atanh", "_o_atanhf", "_o_atanhl"]
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-ms-win-crt-math-l1-1-0.dll"]
api_type: ["DLLExport"]
topic_type: ["apiref"]
f1_keywords: ["atanhl", "atanhf", "atanh"]
-helpviewer_keywords: ["atanhf function", "atanhl function", "atanh funciton"]
-ms.assetid: 83a43b5b-2580-4461-854f-dc84236d9f32
+helpviewer_keywords: ["atanhf function", "atanhl function", "atanh function"]
---
# `atanh`, `atanhf`, `atanhl`
diff --git a/docs/c-runtime-library/reference/bitand.md b/docs/c-runtime-library/reference/bitand.md
index cc4b84b0bd..0701824a21 100644
--- a/docs/c-runtime-library/reference/bitand.md
+++ b/docs/c-runtime-library/reference/bitand.md
@@ -1,13 +1,12 @@
---
-description: "Learn more about: bitand"
title: "bitand"
+description: "Learn more about: bitand"
ms.date: "11/04/2016"
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: ["std::bitand", "std.bitand", "ISO646/bitand", "bitand"]
helpviewer_keywords: ["bitand function"]
-ms.assetid: 279cf9b5-fac1-49de-b329-f1a31b3481fe
---
# `bitand`
@@ -16,7 +15,6 @@ An alternative to the & operator.
## Syntax
```C
-
#define bitand &
```
diff --git a/docs/c-runtime-library/reference/bitor.md b/docs/c-runtime-library/reference/bitor.md
index 4451365a0e..8f2aaf236d 100644
--- a/docs/c-runtime-library/reference/bitor.md
+++ b/docs/c-runtime-library/reference/bitor.md
@@ -1,13 +1,12 @@
---
-description: "Learn more about: bitor"
title: "bitor"
+description: "Learn more about: bitor"
ms.date: "11/04/2016"
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: ["ISO646/bitor", "bitor", "std.bitor", "std::bitor"]
helpviewer_keywords: ["bitor function"]
-ms.assetid: 3c0a3711-9c74-41f2-b400-2f7797da30d1
---
# `bitor`
@@ -16,7 +15,6 @@ An alternative to the `|` operator.
## Syntax
```C
-
#define bitor |
```
diff --git a/docs/c-runtime-library/reference/calloc-dbg.md b/docs/c-runtime-library/reference/calloc-dbg.md
index 0c3df65724..fbff456b61 100644
--- a/docs/c-runtime-library/reference/calloc-dbg.md
+++ b/docs/c-runtime-library/reference/calloc-dbg.md
@@ -1,6 +1,6 @@
---
-description: "Learn more about: _calloc_dbg"
title: "_calloc_dbg"
+description: "Learn more about: _calloc_dbg"
ms.date: "11/04/2016"
api_name: ["_calloc_dbg"]
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"]
@@ -8,7 +8,6 @@ api_type: ["DLLExport"]
topic_type: ["apiref"]
f1_keywords: ["_calloc_dbg", "calloc_dbg"]
helpviewer_keywords: ["_calloc_dbg function", "calloc_dbg function"]
-ms.assetid: 7f62c42b-eb9f-4de5-87d0-df57036c87de
---
# `_calloc_dbg`
@@ -37,7 +36,7 @@ Requested size of each memory block (bytes).
*`blockType`*\
Requested type of memory block: `_CLIENT_BLOCK` or `_NORMAL_BLOCK`.
-For information about the allocation block types and how they're used, see[Types of blocks on the debug heap](../crt-debug-heap-details.md#types-of-blocks-on-the-debug-heap).
+For information about the allocation block types and how they're used, see [Types of blocks on the debug heap](../crt-debug-heap-details.md#types-of-blocks-on-the-debug-heap).
*`filename`*\
Pointer to name of the source file that requested allocation operation or `NULL`.
@@ -100,7 +99,7 @@ int main( void )
else
printf( "Problem allocating memory\n" );
- / _free_dbg must be called to free CLIENT type blocks
+ // _free_dbg must be called to free CLIENT type blocks
free( bufferN );
_free_dbg( bufferC, _CLIENT_BLOCK );
}
diff --git a/docs/c-runtime-library/reference/cgets-s-cgetws-s.md b/docs/c-runtime-library/reference/cgets-s-cgetws-s.md
index 8709404d4c..82de69ea28 100644
--- a/docs/c-runtime-library/reference/cgets-s-cgetws-s.md
+++ b/docs/c-runtime-library/reference/cgets-s-cgetws-s.md
@@ -1,6 +1,6 @@
---
-description: "Learn more about: _cgets_s, _cgetws_s"
title: "_cgets_s, _cgetws_s"
+description: "Learn more about: _cgets_s, _cgetws_s"
ms.date: "4/2/2020"
api_name: ["_cgetws_s", "_cgets_s", "_o__cgets_s", "_o__cgetws_s"]
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-ms-win-crt-conio-l1-1-0.dll"]
@@ -8,7 +8,6 @@ api_type: ["DLLExport"]
topic_type: ["apiref"]
f1_keywords: ["_cgets_s", "cgets_s", "cgetws_s", "_cgetws_s"]
helpviewer_keywords: ["strings [C++], getting from console", "console, getting strings from", "_cgets_s function", "cget_s function", "_cgetws_s function", "cgetws_s function"]
-ms.assetid: 38b74897-afe6-4dd9-a43f-36a3c0d72c5c
---
# `_cgets_s`, `_cgetws_s`
@@ -26,7 +25,7 @@ errno_t _cgets_s(
size_t *pSizeRead
);
errno_t _cgetws_s(
- wchar_t *buffer
+ wchar_t *buffer,
size_t numberOfElements,
size_t *pSizeRead
);
diff --git a/docs/c-runtime-library/reference/controlfp-s.md b/docs/c-runtime-library/reference/controlfp-s.md
index d955dfb42e..8de3df8b7c 100644
--- a/docs/c-runtime-library/reference/controlfp-s.md
+++ b/docs/c-runtime-library/reference/controlfp-s.md
@@ -1,7 +1,7 @@
---
description: "Learn more about: _controlfp_s"
title: "_controlfp_s"
-ms.date: "4/2/2020"
+ms.date: 03/27/2025
api_name: ["_controlfp_s", "_o__controlfp_s"]
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-ms-win-crt-runtime-l1-1-0.dll"]
api_type: ["DLLExport"]
@@ -75,16 +75,23 @@ _controlfp_s(¤t_word, _DN_FLUSH, _MCW_DN);
// and x64 processors with SSE2 support. Ignored on other x86 platforms.
```
-On ARM platforms, the **`_controlfp_s`** function applies to the FPSCR register. On x64 architectures, only the SSE2 control word that's stored in the MXCSR register is affected. On Intel (x86) platforms, **`_controlfp_s`** affects the control words for both the x87 and the SSE2, if present. It's possible for the two control words to be inconsistent with each other (because of a previous call to [`__control87_2`](control87-controlfp-control87-2.md), for example); if there's an inconsistency between the two control words, **`_controlfp_s`** sets the `EM_AMBIGUOUS` flag in *`currentControl`*. It's a warning that the returned control word might not represent the state of both floating-point control words accurately.
+This function is ignored when you use [`/clr` (Common Language Runtime Compilation)](../../build/reference/clr-common-language-runtime-compilation.md) to compile because the common language runtime (CLR) only supports the default floating-point precision.
-On the ARM and x64 architectures, changing the infinity mode or the floating-point precision isn't supported. If the precision control mask is used on the x64 platform, the function raises an assertion and the invalid parameter handler is invoked, as described in [Parameter validation](../parameter-validation.md).
+On x64, only the SSE2 control word stored in the MXCSR register is affected. Changing the infinity mode or the floating-point precision isn't supported. If the precision control mask is used on the x64 platform, the function raises an assertion and the invalid parameter handler is invoked as described in [Parameter validation](../parameter-validation.md).
-If the mask isn't set correctly, this function generates an invalid parameter exception, as described in [Parameter validation](../parameter-validation.md). If execution is allowed to continue, this function returns `EINVAL` and sets `errno` to `EINVAL`.
+On x86, **`_controlfp_s`** affects the control words for both the x87 and the SSE2, if present. It's possible for the two control words to be inconsistent with each other (because of a previous call to [`__control87_2`](control87-controlfp-control87-2.md), for example); if there's an inconsistency between the two control words, **`_controlfp_s`** sets the `EM_AMBIGUOUS` flag in *`currentControl`*. It's a warning that the returned control word might not represent the state of both floating-point control words accurately.
-This function is ignored when you use [`/clr` (Common Language Runtime Compilation)](../../build/reference/clr-common-language-runtime-compilation.md) to compile because the common language runtime (CLR) only supports the default floating-point precision.
+If the mask isn't set correctly, this function generates an invalid parameter exception, as described in [Parameter validation](../parameter-validation.md). If execution is allowed to continue, this function returns `EINVAL` and sets `errno` to `EINVAL`.
By default, this function's global state is scoped to the application. To change this behavior, see [Global state in the CRT](../global-state.md).
+### Arm platforms
+
+- Changing the infinity mode or the floating-point precision isn't supported. If the precision control mask is used on the x64 platform, the function raises an assertion and the invalid parameter handler is invoked, as described in [Parameter validation](../parameter-validation.md).
+- On ARM32 (discontinued), Windows doesn't support FP exceptions.
+- On ARM64, unmasking the whole `_MCW_EM` or any bits from it (`_EM_INEXACT`, `_EM_UNDERFLOW`, `_EM_OVERFLOW`, `_EM_ZERODIVIDE`, and `_EM_INVALID`) correctly change the FPCR register. Floating point exceptions raised by standard math functions, like Invalid operation from `std::acos`, are exempt from this behavior and can be ignored or raised properly depending on the FPCR register. For more information, see [Overview of ARM32 ABI Conventions](../../build/overview-of-arm-abi-conventions.md#floating-point-exceptions).
+- On ARM64EC, Windows catches processor floating-point exceptions and disables them in the FPCR register. This ensures consistent behavior across different processor variants.
+
### Mask constants and values
For the `_MCW_EM` mask, clearing it sets the exception, which allows the hardware exception; setting it hides the exception. If a `_EM_UNDERFLOW` or `_EM_OVERFLOW` occurs, no hardware exception is thrown until the next floating-point instruction is executed. To generate a hardware exception immediately after `_EM_UNDERFLOW` or `_EM_OVERFLOW`, call the `FWAIT MASM` instruction.
diff --git a/docs/c-runtime-library/reference/crtcheckmemory.md b/docs/c-runtime-library/reference/crtcheckmemory.md
index de0f6e98ce..5c9ca5d58e 100644
--- a/docs/c-runtime-library/reference/crtcheckmemory.md
+++ b/docs/c-runtime-library/reference/crtcheckmemory.md
@@ -1,6 +1,6 @@
---
-description: "Learn more about: _CrtCheckMemory"
title: "_CrtCheckMemory"
+description: "Learn more about: _CrtCheckMemory"
ms.date: "11/04/2016"
api_name: ["_CrtCheckMemory"]
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"]
@@ -8,7 +8,6 @@ api_type: ["DLLExport"]
topic_type: ["apiref"]
f1_keywords: ["CrtCheckMemory", "_CrtCheckMemory"]
helpviewer_keywords: ["_CrtCheckMemory function", "CrtCheckMemory function"]
-ms.assetid: 457cc72e-60fd-4177-ab5c-6ae26a420765
---
# `_CrtCheckMemory`
@@ -17,7 +16,6 @@ Confirms the integrity of the memory blocks allocated in the debug heap (debug v
## Syntax
```C
-
int _CrtCheckMemory( void );
```
diff --git a/docs/c-runtime-library/reference/crtdumpmemoryleaks.md b/docs/c-runtime-library/reference/crtdumpmemoryleaks.md
index 5e934bfd26..28291b7a9c 100644
--- a/docs/c-runtime-library/reference/crtdumpmemoryleaks.md
+++ b/docs/c-runtime-library/reference/crtdumpmemoryleaks.md
@@ -1,6 +1,6 @@
---
-description: "Learn more about: _CrtDumpMemoryLeaks"
title: "_CrtDumpMemoryLeaks"
+description: "Learn more about: _CrtDumpMemoryLeaks"
ms.date: "11/04/2016"
api_name: ["_CrtDumpMemoryLeaks"]
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"]
@@ -16,7 +16,6 @@ Dumps all the memory blocks in the debug heap when a memory leak has occurred (d
## Syntax
```C
-
int _CrtDumpMemoryLeaks( void );
```
diff --git a/docs/c-runtime-library/reference/crtreportblocktype.md b/docs/c-runtime-library/reference/crtreportblocktype.md
index 48220ad606..e9c58f7c24 100644
--- a/docs/c-runtime-library/reference/crtreportblocktype.md
+++ b/docs/c-runtime-library/reference/crtreportblocktype.md
@@ -1,14 +1,13 @@
---
-description: "Learn more about: _CrtReportBlockType"
title: "_CrtReportBlockType"
-ms.date: "11/04/2016"
+description: "Learn more about: _CrtReportBlockType"
+ms.date: 11/04/2016
api_name: ["_CrtReportBlockType"]
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: ["_CrtReportBlockType", "CrtReportBlockType"]
helpviewer_keywords: ["CrtReportBlockType function", "BLOCK_SUBTYPE macro", "_CrtReportBlockType function", "_BLOCK_TYPE macro", "_BLOCK_SUBTYPE macro", "BLOCK_TYPE macro"]
-ms.assetid: 0f4b9da7-bebb-4956-9541-b2581640ec6b
---
# `_CrtReportBlockType`
@@ -19,7 +18,7 @@ Returns the block type/subtype associated with a given debug heap block pointer.
```C
int _CrtReportBlockType(
const void * pBlock
-};
+);
```
### Parameters
diff --git a/docs/c-runtime-library/reference/crtsetdebugfillthreshold.md b/docs/c-runtime-library/reference/crtsetdebugfillthreshold.md
index bd91d7fa57..b7ce8b7bbb 100644
--- a/docs/c-runtime-library/reference/crtsetdebugfillthreshold.md
+++ b/docs/c-runtime-library/reference/crtsetdebugfillthreshold.md
@@ -1,14 +1,13 @@
---
title: "_CrtSetDebugFillThreshold"
description: "Use the _CrtSetDebugFillThreshold function to set the maximum amount of buffer to fill in secure CRT functions."
-ms.date: "10/31/2019"
+ms.date: 04/10/2025
api_name: ["_CrtSetDebugFillThreshold"]
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: ["_CrtSetDebugFillThreshold", "CrtSetDebugFillThreshold"]
helpviewer_keywords: ["debug, buffer-filling behavior", "CrtSetDebugFillThreshold function", "_CrtSetDebugFillThreshold function", "buffer-filling behavior", "0xFE"]
-ms.assetid: 6cb360e8-56ae-4248-b17f-e28aee3e0ed7
---
# `_CrtSetDebugFillThreshold`
@@ -38,58 +37,36 @@ The default threshold is `SIZE_T_MAX`.
Here's a list of the affected functions:
- [`asctime_s`, `_wasctime_s`](asctime-s-wasctime-s.md)
-
- [`_cgets_s`, `_cgetws_s`](cgets-s-cgetws-s.md)
-
- [`ctime_s`, `_ctime32_s`, `_ctime64_s`, `_wctime_s`, `_wctime32_s`, `_wctime64_s`](ctime-s-ctime32-s-ctime64-s-wctime-s-wctime32-s-wctime64-s.md)
-
- [`_ecvt_s`](ecvt-s.md)
-
- [`_fcvt_s`](fcvt-s.md)
-
- [`_gcvt_s`](gcvt-s.md)
-
- [`_itoa_s`, `_ltoa_s`, `_ultoa_s`, `_i64toa_s`, `_ui64toa_s`, `_itow_s`, `_ltow_s`, `_ultow_s`, `_i64tow_s`, `_ui64tow_s`](itoa-s-itow-s.md)
-
- [`_makepath_s`, `_wmakepath_s`](makepath-s-wmakepath-s.md)
-
- [`_mbsnbcat_s`, `_mbsnbcat_s_l`](mbsnbcat-s-mbsnbcat-s-l.md)
-
- [`_mbsnbcpy_s`, `_mbsnbcpy_s_l`](mbsnbcpy-s-mbsnbcpy-s-l.md)
-
- [`_mbsnbset_s`, `_mbsnbset_s_l`](mbsnbset-s-mbsnbset-s-l.md)
-
- [`_mktemp_s`, `_wmktemp_s`](makepath-s-wmakepath-s.md)
-
- [`_splitpath_s`, `_wsplitpath_s`](splitpath-s-wsplitpath-s.md)
-
- [`strcat_s`, `wcscat_s`, `_mbscat_s`](strcat-s-wcscat-s-mbscat-s.md)
-
- [`strcpy_s`, `wcscpy_s`, `_mbscpy_s`](strcpy-s-wcscpy-s-mbscpy-s.md)
-
- [`_strdate_s`, `_wstrdate_s`](strdate-s-wstrdate-s.md)
-
- [`strerror_s`, `_strerror_s`, `_wcserror_s`, `__wcserror_s`](strerror-s-strerror-s-wcserror-s-wcserror-s.md)
-
- [`_strlwr_s`, `_strlwr_s_l`, `_mbslwr_s`, `_mbslwr_s_l`, `_wcslwr_s`, `_wcslwr_s_l`](strlwr-s-strlwr-s-l-mbslwr-s-mbslwr-s-l-wcslwr-s-wcslwr-s-l.md)
-
- [`strncat_s`, `_strncat_s_l`, `wcsncat_s`, `_wcsncat_s_l`, `_mbsncat_s`, `_mbsncat_s_l`](strncat-s-strncat-s-l-wcsncat-s-wcsncat-s-l-mbsncat-s-mbsncat-s-l.md)
-
- [`strncpy_s`, `_strncpy_s_l`, `wcsncpy_s`, `_wcsncpy_s_l`, `_mbsncpy_s`, `_mbsncpy_s_l`](strncpy-s-strncpy-s-l-wcsncpy-s-wcsncpy-s-l-mbsncpy-s-mbsncpy-s-l.md)
-
- [`_strnset_s`, `_strnset_s_l`, `_wcsnset_s`, `_wcsnset_s_l`, `_mbsnset_s`, `_mbsnset_s_l`](strnset-s-strnset-s-l-wcsnset-s-wcsnset-s-l-mbsnset-s-mbsnset-s-l.md)
-
- [`_strset_s`, `_strset_s_l`, `_wcsset_s`, `_wcsset_s_l`, `_mbsset_s`, `_mbsset_s_l`](strset-s-strset-s-l-wcsset-s-wcsset-s-l-mbsset-s-mbsset-s-l.md)
-
- [`_strtime_s`, `_wstrtime_s`](strtime-s-wstrtime-s.md)
-
- [`_strupr_s`, `_strupr_s_l`, `_mbsupr_s`, `_mbsupr_s_l`, `_wcsupr_s`, `_wcsupr_s_l`](strupr-s-strupr-s-l-mbsupr-s-mbsupr-s-l-wcsupr-s-wcsupr-s-l.md)
-
+- [`vsnprintf_s`, `_vsnprintf_s`, `_vsnprintf_s_l`, `_vsnwprintf_s`, _vsnwpr`intf_s_l](vsnprintf-s-vsnprintf-s-vsnprintf-s-l-vsnwprintf-s-vsnwprintf-s-l.md)
+
## Requirements
| Routine | Required header |
|---|---|
-| **`_CrtSetDebugFillThreshold`** | \ |
+| **`_CrtSetDebugFillThreshold`** | `` |
This function is Microsoft-specific. For more compatibility information, see [Compatibility](../compatibility.md).
diff --git a/docs/c-runtime-library/reference/cxxthrowexception.md b/docs/c-runtime-library/reference/cxxthrowexception.md
index 1bad3b4dd0..2a2a3b87b6 100644
--- a/docs/c-runtime-library/reference/cxxthrowexception.md
+++ b/docs/c-runtime-library/reference/cxxthrowexception.md
@@ -1,6 +1,6 @@
---
-description: "Learn more about: _CxxThrowException"
title: "_CxxThrowException"
+description: "Learn more about: _CxxThrowException"
ms.date: "11/04/2016"
api_name: ["_CxxThrowException"]
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"]
@@ -8,7 +8,6 @@ api_type: ["DLLExport"]
topic_type: ["apiref"]
f1_keywords: ["CxxThrowException", "_CxxThrowException"]
helpviewer_keywords: ["_CxxThrowException function", "CxxThrowException function"]
-ms.assetid: 0b90bef5-b7d2-46e0-88e2-59e531e01a4d
---
# `_CxxThrowException`
@@ -18,7 +17,7 @@ Builds the exception record and calls the runtime environment to start processin
```C
extern "C" void __stdcall _CxxThrowException(
- void* pExceptionObject
+ void* pExceptionObject,
_ThrowInfo* pThrowInfo
);
```
diff --git a/docs/c-runtime-library/reference/dupenv-s-dbg-wdupenv-s-dbg.md b/docs/c-runtime-library/reference/dupenv-s-dbg-wdupenv-s-dbg.md
index cfc0b250e2..047aba34af 100644
--- a/docs/c-runtime-library/reference/dupenv-s-dbg-wdupenv-s-dbg.md
+++ b/docs/c-runtime-library/reference/dupenv-s-dbg-wdupenv-s-dbg.md
@@ -1,6 +1,6 @@
---
-description: "Learn more about: _dupenv_s_dbg, _wdupenv_s_dbg"
title: "_dupenv_s_dbg, _wdupenv_s_dbg"
+description: "Learn more about: _dupenv_s_dbg, _wdupenv_s_dbg"
ms.date: "11/04/2016"
api_name: ["_dupenv_s_dbg", "_wdupenv_s_dbg"]
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"]
@@ -8,7 +8,6 @@ api_type: ["DLLExport"]
topic_type: ["apiref"]
f1_keywords: ["_tdupenv_s_dbg", "_dupenv_s_dbg", "_wdupenv_s_dbg"]
helpviewer_keywords: ["_tdupenv_s_dbg function", "dupenv_s_dbg function", "_wdupenv_s_dbg function", "environment variables", "tdupenv_s_dbg function", "wdupenv_s_dbg function", "_dupenv_s_dbg function"]
-ms.assetid: e3d81148-e24e-46d0-a21d-fd87b5e6256c
---
# `_dupenv_s_dbg`, `_wdupenv_s_dbg`
@@ -88,7 +87,7 @@ For more compatibility information, see [Compatibility](../compatibility.md).
```C
// crt_dupenv_s_dbg.c
-#include
+#include
#include
int main( void )
diff --git a/docs/c-runtime-library/reference/dupenv-s-wdupenv-s.md b/docs/c-runtime-library/reference/dupenv-s-wdupenv-s.md
index e0d4242db2..da9fb11032 100644
--- a/docs/c-runtime-library/reference/dupenv-s-wdupenv-s.md
+++ b/docs/c-runtime-library/reference/dupenv-s-wdupenv-s.md
@@ -1,6 +1,6 @@
---
-description: "Learn more about: _dupenv_s, _wdupenv_s"
title: "_dupenv_s, _wdupenv_s"
+description: "Learn more about: _dupenv_s, _wdupenv_s"
ms.date: "4/2/2020"
api_name: ["_dupenv_s", "_wdupenv_s", "_o__dupenv_s", "_o__wdupenv_s"]
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-ms-win-crt-environment-l1-1-0.dll"]
@@ -8,7 +8,6 @@ api_type: ["DLLExport"]
topic_type: ["apiref"]
f1_keywords: ["tdupenv_s", "_dupenv_s", "wdupenv_s", "dupenv_s", "_tdupenv_s", "_wdupenv_s"]
helpviewer_keywords: ["_dupenv_s function", "_tdupenv_s function", "_wdupenv_s function", "environment variables", "wdupenv_s function", "dupenv_s function", "tdupenv_s function"]
-ms.assetid: b729ecc2-a31d-4ccf-92a7-5accedb8f8c8
---
# `_dupenv_s`, `_wdupenv_s`
@@ -89,7 +88,7 @@ For more compatibility information, see [Compatibility](../compatibility.md).
```C
// crt_dupenv_s.c
-#include
+#include
int main( void )
{
diff --git a/docs/c-runtime-library/reference/exit-exit-exit.md b/docs/c-runtime-library/reference/exit-exit-exit.md
index 1ad98c4dc5..bcec154714 100644
--- a/docs/c-runtime-library/reference/exit-exit-exit.md
+++ b/docs/c-runtime-library/reference/exit-exit-exit.md
@@ -14,7 +14,7 @@ helpviewer_keywords: ["exit function", "_exit function", "processes, terminating
Terminates the calling process. The **`exit`** function terminates it after cleanup; **`_exit`** and **`_Exit`** terminate it immediately.
> [!NOTE]
-> Do not use this method to shut down a Universal Windows Platform (UWP) app, except in testing or debugging scenarios. Programmatic or UI ways to close a Store app are not permitted according to the [Microsoft Store policies](/legal/windows/agreements/store-policies). For more information, see [UWP app lifecycle](/windows/uwp/launch-resume/app-lifecycle). For more information about UWP apps, see [Universal Windows Platform documentation](https://developer.microsoft.com/windows/apps).
+> Do not use this method to shut down a Universal Windows Platform (UWP) app, except in testing or debugging scenarios. Programmatic or UI ways to close a Store app are not permitted according to the [Microsoft Store policies](/windows/apps/publish/store-policies). For more information, see [UWP app lifecycle](/windows/uwp/launch-resume/app-lifecycle). For more information about UWP apps, see [Universal Windows Platform documentation](https://developer.microsoft.com/windows/apps).
## Syntax
diff --git a/docs/c-runtime-library/reference/exp2-exp2f-exp2l.md b/docs/c-runtime-library/reference/exp2-exp2f-exp2l.md
index b2d84ff608..bf7a2e2893 100644
--- a/docs/c-runtime-library/reference/exp2-exp2f-exp2l.md
+++ b/docs/c-runtime-library/reference/exp2-exp2f-exp2l.md
@@ -8,7 +8,6 @@ api_type: ["DLLExport"]
topic_type: ["apiref"]
f1_keywords: ["exp2", "math/exp2", "exp2f", "math/exp2f", "exp2l", "math/exp2l"]
helpviewer_keywords: ["exp2 function", "exp2f function", "exp2l function"]
-ms.assetid: 526e3e10-201a-4610-a886-533f44ece344
---
# `exp2`, `exp2f`, `exp2l`
@@ -79,5 +78,5 @@ For more compatibility information, see [Compatibility](../compatibility.md).
## See also
[Alphabetical function reference](crt-alphabetical-function-reference.md)\
-[`exp`, `expf`, `expl`](exp-expf.md)
+[`exp`, `expf`, `expl`](exp-expf.md)\
[`log2`, `log2f`, `log2l`](log2-log2f-log2l.md)
diff --git a/docs/c-runtime-library/reference/findfirst-functions.md b/docs/c-runtime-library/reference/findfirst-functions.md
index d34d13c777..dcfbffe363 100644
--- a/docs/c-runtime-library/reference/findfirst-functions.md
+++ b/docs/c-runtime-library/reference/findfirst-functions.md
@@ -72,7 +72,7 @@ intptr_t _wfindfirst64i32(
Target file specification (can include wildcard characters).
*`fileinfo`*\
-File information buffer.
+File information buffer. For more information about the `fileinfo` structs, see the Remarks in [Filename search functions](../filename-search-functions.md) and see [Data type mappings](../data-type-mappings.md). The structs are defined in the same header file as the function that uses them as a parameter.
## Return value
@@ -101,7 +101,7 @@ These functions use various forms of the **`_finddata_t`** structure for the *`f
The variations that use a 64-bit time type enable file-creation dates to be expressed up through 23:59:59, December 31, 3000, UTC. The ones that use 32-bit time types represent dates only through 23:59:59 January 18, 2038, UTC. Midnight, January 1, 1970, is the lower bound of the date range for all these functions.
-Unless you have a specific reason to use the versions that specify the time size explicitly, use **`_findfirst`** or **`_wfindfirst`** or, if you need to support file sizes larger than 3 GB, use **`_findfirsti64`** or **`_wfindfirsti64`**. All these functions use the 64-bit time type. In earlier versions, these functions used a 32-bit time type. If this change is a breaking change for an application, you might define `_USE_32BIT_TIME_T` to revert to the old behavior. If `_USE_32BIT_TIME_T` is defined, **`_findfirst`**, **`_finfirsti64`**, and their corresponding Unicode versions use a 32-bit time.
+Unless you have a specific reason to use the versions that specify the time size explicitly, use **`_findfirst`** or **`_wfindfirst`** or, if you need to support file sizes larger than 3 GB, use **`_findfirsti64`** or **`_wfindfirsti64`**. All these functions use the 64-bit time type. In earlier versions, these functions used a 32-bit time type. If this change is a breaking change for an application, you might define `_USE_32BIT_TIME_T` to revert to the old behavior. If `_USE_32BIT_TIME_T` is defined, **`_findfirst`**, **`_findfirsti64`**, and their corresponding Unicode versions use a 32-bit time.
By default, this function's global state is scoped to the application. To change this behavior, see [Global state in the CRT](../global-state.md).
diff --git a/docs/c-runtime-library/reference/floating-point-ordering.md b/docs/c-runtime-library/reference/floating-point-ordering.md
index ece44b97be..acdf45961d 100644
--- a/docs/c-runtime-library/reference/floating-point-ordering.md
+++ b/docs/c-runtime-library/reference/floating-point-ordering.md
@@ -1,6 +1,6 @@
---
-description: "Learn more about: isgreater, isgreaterequal, isless, islessequal, islessgreater, isunordered"
title: "isgreater, isgreaterequal, isless, islessequal, islessgreater, isunordered"
+description: "Learn more about: isgreater, isgreaterequal, isless, islessequal, islessgreater, isunordered"
ms.date: "01/31/2019"
f1_keywords: ["isgreater", "math/isgreater", "isgreaterequal", "math/isgreaterequal", "isless", "math/isless", "islessequal", "math/islessequal", "islessgreater", "math/islessgreater", "isunordered", "math/isunordered"]
helpviewer_keywords: ["isgreater function", "isgreaterequal function", "isless function", "islessequal function", "islessgreater function", "isunordered function"]
@@ -43,7 +43,7 @@ int isunordered(
); /* C-only macro */
```
-```C++
+```cpp
template
inline bool isgreater(
FloatingType1 x,
diff --git a/docs/c-runtime-library/reference/fopen-s-wfopen-s.md b/docs/c-runtime-library/reference/fopen-s-wfopen-s.md
index 1efd939eec..6964db2b65 100644
--- a/docs/c-runtime-library/reference/fopen-s-wfopen-s.md
+++ b/docs/c-runtime-library/reference/fopen-s-wfopen-s.md
@@ -153,6 +153,7 @@ Valid characters for the *`mode`* string used in **`fopen_s`** and [`_fdopen`](f
| **`t`** | `_O_TEXT` (translated) |
| **`c`** | None |
| **`n`** | None |
+| **`N`** | `_O_NOINHERIT` |
| **`D`** | `_O_TEMPORARY` |
| **`R`** | `_O_RANDOM` |
| **`S`** | `_O_SEQUENTIAL` |
@@ -166,7 +167,7 @@ The **`c`**, **`n`**, **`R`**, **`S`**, **`t`**, **`T`**, and **`D`** *`mode`* o
If you're using **`rb`** mode, memory mapped Win32 files might also be an option if you don't need to port your code, you expect to read much of the file, or you don't care about network performance.
Regarding `T` and `D`:
-- `T` avoids writing the file to disk as long as memory pressure doesn't require it. For more information, see `FILE_ATTRIBUTE_TEMPORARY` in [File attribute constants](/windows/win32/fileio/file-attribute-constants), and also this blog post [It's only temporary](https://learn.microsoft.com/archive/blogs/larryosterman/its-only-temporary).
+- `T` avoids writing the file to disk as long as memory pressure doesn't require it. For more information, see `FILE_ATTRIBUTE_TEMPORARY` in [File attribute constants](/windows/win32/fileio/file-attribute-constants), and also this blog post [It's only temporary](/archive/blogs/larryosterman/its-only-temporary).
- `D` specifies a regular file that is written to disk. The difference is that it's automatically deleted when it's closed.
You can combine `TD` to get both semantics.
diff --git a/docs/c-runtime-library/reference/fopen-wfopen.md b/docs/c-runtime-library/reference/fopen-wfopen.md
index 3756a268d0..22d44f2421 100644
--- a/docs/c-runtime-library/reference/fopen-wfopen.md
+++ b/docs/c-runtime-library/reference/fopen-wfopen.md
@@ -1,6 +1,6 @@
---
-description: "Learn more about: fopen, _wfopen"
title: "fopen, _wfopen"
+description: "Learn more about: fopen, _wfopen"
ms.date: 04/27/2023
api_name: ["_wfopen", "fopen", "_o__wfopen", "_o_fopen"]
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-ms-win-crt-stdio-l1-1-0.dll"]
@@ -136,7 +136,7 @@ Valid characters for the *`mode`* string that is used in **`fopen`** and **`_fdo
| Characters in *`mode`* string | Equivalent *`oflag`* value for `_open`/`_sopen` |
|--|--|
| **`a`** | `_O_WRONLY | _O_APPEND` (usually `_O_WRONLY | _O_CREAT | _O_APPEND`) |
-| **`a+`** | `_O_RDWR | _O_APPEND` (usually `_O_RDWR | _O_APPEND | _O_CREAT` ) |
+| **`a+`** | `_O_RDWR | _O_APPEND` (usually `_O_RDWR | _O_APPEND | _O_CREAT`) |
| **`r`** | `_O_RDONLY` |
| **`r+`** | `_O_RDWR` |
| **`w`** | `_O_WRONLY` (usually `_O_WRONLY | _O_CREAT | _O_TRUNC`) |
@@ -146,6 +146,7 @@ Valid characters for the *`mode`* string that is used in **`fopen`** and **`_fdo
| **`x`** | `_O_EXCL` |
| **`c`** | None |
| **`n`** | None |
+| **`N`** | `_O_NOINHERIT` |
| **`S`** | `_O_SEQUENTIAL` |
| **`R`** | `_O_RANDOM` |
| **`T`** | `_O_SHORTLIVED` |
@@ -157,7 +158,7 @@ Valid characters for the *`mode`* string that is used in **`fopen`** and **`_fdo
If you're using **`rb`** mode, you don't have to port your code, and if you expect to read most of a large file or aren't concerned about network performance, you might also consider whether to use memory mapped Win32 files as an option.
Regarding `T` and `D`:
-- `T` avoids writing the file to disk as long as memory pressure doesn't require it. For more information, see `FILE_ATTRIBUTE_TEMPORARY` in [File attribute constants](/windows/win32/fileio/file-attribute-constants), and also this blog post [It's only temporary](https://learn.microsoft.com/archive/blogs/larryosterman/its-only-temporary).
+- `T` avoids writing the file to disk as long as memory pressure doesn't require it. For more information, see `FILE_ATTRIBUTE_TEMPORARY` in [File attribute constants](/windows/win32/fileio/file-attribute-constants), and also this blog post [It's only temporary](/archive/blogs/larryosterman/its-only-temporary).
- `D` specifies a regular file that is written to disk. The difference is that it's automatically deleted when it's closed.
You can combine `TD` to get both semantics.
diff --git a/docs/c-runtime-library/reference/fprintf-fprintf-l-fwprintf-fwprintf-l.md b/docs/c-runtime-library/reference/fprintf-fprintf-l-fwprintf-fwprintf-l.md
index 581d61746a..2d972d963a 100644
--- a/docs/c-runtime-library/reference/fprintf-fprintf-l-fwprintf-fwprintf-l.md
+++ b/docs/c-runtime-library/reference/fprintf-fprintf-l-fwprintf-fwprintf-l.md
@@ -1,18 +1,20 @@
---
-description: "Learn more about: fprintf, _fprintf_l, fwprintf, _fwprintf_l"
-title: "fprintf, _fprintf_l, fwprintf, _fwprintf_l"
+description: "Learn more about: fprintf, _fprintf_l, fwprintf, _ftprintf, _ftprintf_l"
+title: "fprintf, _fprintf_l, fwprintf, _fwprintf_l, _ftprintf, _ftprintf_l"
ms.date: "3/9/2021"
-api_name: ["fwprintf", "fprintf", "_fprintf_l", "_fwprintf_l"]
+api_name: ["fwprintf", "fprintf", "_fprintf_l", "_fwprintf_l", "_ftprintf", "_ftprintf_l"]
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: ["fprintf", "fwprintf", "_ftprintf", "_fwprintf_l"]
-helpviewer_keywords: ["_fwprintf_l function", "fprintf function", "fprintf_l function", "_fprintf_l function", "_ftprintf function", "fwprintf function", "ftprintf_l function", "ftprintf function", "_fwprintf_l function", "_ftprintf_l function", "print formatted data to streams", "fwprintf_l function"]
+f1_keywords: ["fprintf", "fwprintf", "_ftprintf", "_fwprintf_l", "_ftprintf_l"]
+helpviewer_keywords: ["fprintf function", "fprintf_l function", "_fprintf_l function", "_ftprintf function", "fwprintf function", "ftprintf_l function", "ftprintf function", "print formatted data to streams", "fwprintf_l function", "_ftprintf_l function"]
---
-# `fprintf`, `_fprintf_l`, `fwprintf`, `_fwprintf_l`
+# `fprintf`, `_fprintf_l`, `fwprintf`, `_fwprintf_l`, `_ftprintf`, `_ftprintf_l`
Print formatted data to a stream. More secure versions of these functions are available; see [`fprintf_s`, `_fprintf_s_l`, `fwprintf_s`, `_fwprintf_s_l`](fprintf-s-fprintf-s-l-fwprintf-s-fwprintf-s-l.md).
+For `_ftprintf` and `_ftprintf_l`, see [Generic-text function mappings](#generic-text-function-mappings).
+
## Syntax
```C
@@ -73,7 +75,7 @@ The versions of these functions with the **`_l`** suffix are identical except th
>
> Starting in Windows 10 version 2004 (build 19041), the `printf` family of functions prints exactly representable floating point numbers according to the IEEE 754 rules for rounding. In previous versions of Windows, exactly representable floating point numbers ending in '5' would always round up. IEEE 754 states that they must round to the closest even digit (also known as "Banker's Rounding"). For example, both `printf("%1.0f", 1.5)` and `printf("%1.0f", 2.5)` should round to 2. Previously, 1.5 would round to 2 and 2.5 would round to 3. This change only affects exactly representable numbers. For example, 2.35 (which, when represented in memory, is closer to 2.35000000000000008) continues to round up to 2.4. Rounding done by these functions now also respects the floating point rounding mode set by [`fesetround`](fegetround-fesetround2.md). Previously, rounding always chose `FE_TONEAREST` behavior. This change only affects programs built using Visual Studio 2019 version 16.2 and later. To use the legacy floating point rounding behavior, link with ['legacy_stdio_float_rounding.obj`](../link-options.md).
-### Generic-text routine mappings
+### Generic-text function mappings
The function in the `tchar.h` column maps to the function in the other columns depending on the character set that is defined at compile time.
diff --git a/docs/c-runtime-library/reference/fprintf-p-fprintf-p-l-fwprintf-p-fwprintf-p-l.md b/docs/c-runtime-library/reference/fprintf-p-fprintf-p-l-fwprintf-p-fwprintf-p-l.md
index 93b07092f0..8ed284f343 100644
--- a/docs/c-runtime-library/reference/fprintf-p-fprintf-p-l-fwprintf-p-fwprintf-p-l.md
+++ b/docs/c-runtime-library/reference/fprintf-p-fprintf-p-l-fwprintf-p-fwprintf-p-l.md
@@ -1,18 +1,20 @@
---
-description: "Learn more about: _fprintf_p, _fprintf_p_l, _fwprintf_p, _fwprintf_p_l"
+description: "Learn more about: _fprintf_p, _fprintf_p_l, _ftprintf_p, _ftprintf_p_l, _fwprintf_p, _fwprintf_p_l"
title: "_fprintf_p, _fprintf_p_l, _fwprintf_p, _fwprintf_p_l"
ms.date: "3/9/2021"
api_name: ["_fwprintf_p", "_fprintf_p_l", "_fwprintf_p_l", "_fprintf_p"]
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: ["_fprintf_p", "_ftprintf_p", "fwprintf_p", "_fwprintf_p", "fprintf_p", "ftprintf_p", "_fwprintf_p_l"]
-helpviewer_keywords: ["fprintf_p_l function", "fprintf_p function", "_fprintf_p_l function", "_fprintf_p function", "_ftprintf_p_l function", "streams, printing formatted data to", "_fwprintf_p function", "fwprintf_p function", "_ftprintf_p function", "_fwprintf_p_l function", "ftprintf_p function", "printing [C++], formatted data to streams", "ftprintf_p_l function", "fwprintf_p_l function"]
+f1_keywords: ["_fprintf_p", "_ftprintf_p", "_ftprintf_p_l", "fwprintf_p", "_fwprintf_p", "fprintf_p", "ftprintf_p", "_fwprintf_p_l"]
+helpviewer_keywords: ["fprintf_p_l function", "fprintf_p function", "_fprintf_p_l function", "_fprintf_p function", "_ftprintf_p function", "_ftprintf_p_l function", "streams, printing formatted data to", "_fwprintf_p function", "fwprintf_p function", "_fwprintf_p_l function", "ftprintf_p function", "printing [C++], formatted data to streams", "ftprintf_p_l function", "fwprintf_p_l function"]
---
-# `_fprintf_p`, `_fprintf_p_l`, `_fwprintf_p`, `_fwprintf_p_l`
+# `_fprintf_p`, `_fprintf_p_l`, `_ftprintf_p`, `_ftprintf_p_l`, `_fwprintf_p`, `_fwprintf_p_l`
Prints formatted data to a stream.
+For `_ftprintf_p` and `_ftprintf_p_l`, see [Generic-text function mappings](#generic-text-function-mappings).
+
## Syntax
```C
@@ -73,7 +75,7 @@ The versions of these functions with the `_l` suffix are identical except that t
Like the non-secure versions (see [`fprintf`, `_fprintf_l`, `fwprintf`, `_fwprintf_l`](fprintf-fprintf-l-fwprintf-fwprintf-l.md)), these functions validate their parameters and invoke the invalid parameter handler, as described in [Parameter validation](../parameter-validation.md), if either *`stream`* or *`format`* is a null pointer or if there are any unknown or badly formed formatting specifiers. If execution is allowed to continue, the functions return -1 and set `errno` to `EINVAL`.
-### Generic-text routine mappings
+### Generic-text function mappings
The function in the `tchar.h` column maps to the function in the other columns depending on the character set that is defined at compile time.
diff --git a/docs/c-runtime-library/reference/fprintf-s-fprintf-s-l-fwprintf-s-fwprintf-s-l.md b/docs/c-runtime-library/reference/fprintf-s-fprintf-s-l-fwprintf-s-fwprintf-s-l.md
index 1b2ac57aaf..225ec4abc7 100644
--- a/docs/c-runtime-library/reference/fprintf-s-fprintf-s-l-fwprintf-s-fwprintf-s-l.md
+++ b/docs/c-runtime-library/reference/fprintf-s-fprintf-s-l-fwprintf-s-fwprintf-s-l.md
@@ -1,18 +1,20 @@
---
-description: "Learn more about: fprintf_s, _fprintf_s_l, fwprintf_s, _fwprintf_s_l"
-title: "fprintf_s, _fprintf_s_l, fwprintf_s, _fwprintf_s_l"
+description: "Learn more about: fprintf_s, _fprintf_s_l, fwprintf_s, _fwprintf_s_l, _ftprintf_s, _ftprintf_s_l"
+title: "fprintf_s, _fprintf_s_l, fwprintf_s, _fwprintf_s_l, _ftprintf_s, _ftprintf_s_l"
ms.date: "3/9/2021"
-api_name: ["_fprintf_s_l", "fwprintf_s", "fprintf_s", "_fwprintf_s_l"]
+api_name: ["_fprintf_s_l", "fwprintf_s", "fprintf_s", "_fwprintf_s_l", "_ftprintf_s", "_ftprintf_s_l"]
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: ["_ftprintf_s", "fprintf_s", "fwprintf_s", "_fwprintf_s_l"]
-helpviewer_keywords: ["ftprintf_s_l function", "ftprintf_s function", "_fprintf_s_l function", "_ftprintf_s function", "_ftprintf_s_l function", "fwprintf_s_l function", "fwprintf_s function", "fprintf_s_l function", "fprintf_s function", "_fwprintf_s_l function", "_fwprintf_s_l function", "print formatted data to streams"]
+f1_keywords: ["_ftprintf_s", "_ftprintf_s_l", "fprintf_s", "fwprintf_s", "_fwprintf_s_l", "_ftprintf", "_ftprintf_l"]
+helpviewer_keywords: ["ftprintf_s_l function", "ftprintf_s function", "_ftprintf_l function", "_fprintf_s_l function", "_ftprintf_s function", "_ftprintf_s_l function", "fwprintf_s_l function", "fwprintf_s function", "fprintf_s_l function", "fprintf_s function", "_fwprintf_s_l function", "_fwprintf_s_l function", "print formatted data to streams"]
---
-# `fprintf_s`, `_fprintf_s_l`, `fwprintf_s`, `_fwprintf_s_l`
+# `fprintf_s`, `_fprintf_s_l`, `fwprintf_s`, `_fwprintf_s_l`, `_ftprintf`, `_ftprintf_l`, `_ftprintf_s`, `_ftprintf_s_l`
Print formatted data to a stream. These functions are versions of [`fprintf`, `_fprintf_l`, `fwprintf`, `_fwprintf_l`](fprintf-fprintf-l-fwprintf-fwprintf-l.md) with security enhancements as described in [Security features in the CRT](../security-features-in-the-crt.md).
+For `_ftprintf_s` and `_ftprintf_s_l`, see [Generic-text function mappings](#generic-text-function-mappings).
+
## Syntax
```C
@@ -69,12 +71,11 @@ The versions of these functions with the **`_l`** suffix are identical except th
> [!IMPORTANT]
> Ensure that *`format`* is not a user-defined string.
>
->
> Starting in Windows 10 version 2004 (build 19041), the `printf` family of functions prints exactly representable floating point numbers according to the IEEE 754 rules for rounding. In previous versions of Windows, exactly representable floating point numbers ending in '5' would always round up. IEEE 754 states that they must round to the closest even digit (also known as "Banker's Rounding"). For example, both `printf("%1.0f", 1.5)` and `printf("%1.0f", 2.5)` should round to 2. Previously, 1.5 would round to 2 and 2.5 would round to 3. This change only affects exactly representable numbers. For example, 2.35 (which, when represented in memory, is closer to 2.35000000000000008) continues to round up to 2.4. Rounding done by these functions now also respects the floating point rounding mode set by [`fesetround`](fegetround-fesetround2.md). Previously, rounding always chose `FE_TONEAREST` behavior. This change only affects programs built using Visual Studio 2019 version 16.2 and later. To use the legacy floating point rounding behavior, link with ['legacy_stdio_float_rounding.obj`](../link-options.md).
Like the non-secure versions (see [`fprintf`, `_fprintf_l`, `fwprintf`, `_fwprintf_l`](fprintf-fprintf-l-fwprintf-fwprintf-l.md)), these functions validate their parameters and invoke the invalid parameter handler, as described in [Parameter validation](../parameter-validation.md), if either *`stream`* or *`format`* is a `NULL` pointer. The format string itself is also validated. If there are any unknown or badly formed formatting specifiers, these functions generate the invalid parameter exception. In all cases, If execution is allowed to continue, the functions return -1 and set `errno` to `EINVAL`. For more information about return codes, see [`errno`, `_doserrno`, `_sys_errlist`, and `_sys_nerr`](../errno-doserrno-sys-errlist-and-sys-nerr.md).
-### Generic-text routine mappings
+### Generic-text function mappings
The function in the `tchar.h` column maps to the function in the other columns depending on the character set that is defined at compile time.
diff --git a/docs/c-runtime-library/reference/fsopen-wfsopen.md b/docs/c-runtime-library/reference/fsopen-wfsopen.md
index 8f558b4def..5f2c003e22 100644
--- a/docs/c-runtime-library/reference/fsopen-wfsopen.md
+++ b/docs/c-runtime-library/reference/fsopen-wfsopen.md
@@ -76,7 +76,7 @@ When a file is opened with the **"`a`"** or **"`a+`"** access type, all write op
If **`t`** or **`b`** isn't given in *`mode`*, the translation mode is defined by the default-mode variable **`_fmode`**. If **`t`** or **`b`** is prefixed to the argument, the function fails and returns `NULL`. For a discussion of text and binary modes, see [Text and binary mode file I/O](../text-and-binary-mode-file-i-o.md).
Regarding `T` and `D`:
-- `T` avoids writing the file to disk as long as memory pressure doesn't require it. For more information, see `FILE_ATTRIBUTE_TEMPORARY` in [File attribute constants](/windows/win32/fileio/file-attribute-constants), and also this blog post [It's only temporary](https://learn.microsoft.com/archive/blogs/larryosterman/its-only-temporary).
+- `T` avoids writing the file to disk as long as memory pressure doesn't require it. For more information, see `FILE_ATTRIBUTE_TEMPORARY` in [File attribute constants](/windows/win32/fileio/file-attribute-constants), and also this blog post [It's only temporary](/archive/blogs/larryosterman/its-only-temporary).
- `D` specifies a regular file that is written to disk. The difference is that it's automatically deleted when it's closed.
You can combine `TD` to get both semantics.
diff --git a/docs/c-runtime-library/reference/fwide.md b/docs/c-runtime-library/reference/fwide.md
index f21511e106..71113cfe48 100644
--- a/docs/c-runtime-library/reference/fwide.md
+++ b/docs/c-runtime-library/reference/fwide.md
@@ -1,14 +1,13 @@
---
-description: "Learn more about: fwide"
title: "fwide"
-ms.date: "11/04/2016"
+description: "Learn more about: fwide"
+ms.date: 11/04/2016
api_name: ["fwide"]
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: ["fwide"]
helpviewer_keywords: ["fwide function"]
-ms.assetid: a4641f5b-d74f-4946-95d5-53a64610d28d
---
# `fwide`
@@ -19,7 +18,7 @@ Unimplemented.
```C
int fwide(
FILE *stream,
- int mode;
+ int mode
);
```
diff --git a/docs/c-runtime-library/reference/heapchk.md b/docs/c-runtime-library/reference/heapchk.md
index 589d119aef..4e77c83690 100644
--- a/docs/c-runtime-library/reference/heapchk.md
+++ b/docs/c-runtime-library/reference/heapchk.md
@@ -1,6 +1,6 @@
---
-description: "Learn more about: _heapchk"
title: "_heapchk"
+description: "Learn more about: _heapchk"
ms.date: "4/2/2020"
api_name: ["_heapchk", "_o__heapchk"]
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-ms-win-crt-heap-l1-1-0.dll"]
@@ -8,7 +8,6 @@ api_type: ["DLLExport"]
topic_type: ["apiref"]
f1_keywords: ["_heapchk", "heapchk"]
helpviewer_keywords: ["debugging [CRT], heap-related problems", "consistency checking of heaps", "heapchk function", "heaps, checking consistency", "_heapchk function"]
-ms.assetid: 859619a5-1e35-4f02-9e09-11d9fa266ec0
---
# `_heapchk`
@@ -36,7 +35,7 @@ In addition, if an error occurs, **`_heapchk`** sets `errno` to `ENOSYS`.
## Remarks
-The **`_heapchk`** function helps debug heap-related problems by checking for minimal consistency of the heap. If the operating system doesn't support **`_heapchk`**(for example, Windows 98), the function returns `_HEAPOK` and sets `errno` to `ENOSYS`.
+The **`_heapchk`** function helps debug heap-related problems by checking for minimal consistency of the heap. If the operating system doesn't support **`_heapchk`** (for example, Windows 98), the function returns `_HEAPOK` and sets `errno` to `ENOSYS`.
By default, this function's global state is scoped to the application. To change this behavior, see [Global state in the CRT](../global-state.md).
diff --git a/docs/c-runtime-library/reference/heapmin.md b/docs/c-runtime-library/reference/heapmin.md
index ffee2908c1..f5f5e5671a 100644
--- a/docs/c-runtime-library/reference/heapmin.md
+++ b/docs/c-runtime-library/reference/heapmin.md
@@ -1,6 +1,6 @@
---
-description: "Learn more about: _heapmin"
title: "_heapmin"
+description: "Learn more about: _heapmin"
ms.date: "4/2/2020"
api_name: ["_heapmin", "_o__heapmin"]
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-ms-win-crt-heap-l1-1-0.dll"]
@@ -8,7 +8,6 @@ api_type: ["DLLExport"]
topic_type: ["apiref"]
f1_keywords: ["_heapmin", "heapmin"]
helpviewer_keywords: ["heap memory", "minimizing heaps", "memory, releasing", "heaps, releasing unused memory", "_heapmin function", "heapmin function"]
-ms.assetid: c0bccdf6-2d14-4d7b-a7ff-d6a17bdb410f
---
# `_heapmin`
@@ -28,7 +27,7 @@ For more information about this and other return codes, see [`errno`, `_doserrno
## Remarks
-The **`_heapmin`** function minimizes the heap by releasing unused heap memory to the operating system. If the operating system doesn't support **`_heapmin`**(for example, Windows 98), the function returns -1 and sets `errno` to `ENOSYS`.
+The **`_heapmin`** function minimizes the heap by releasing unused heap memory to the operating system. If the operating system doesn't support **`_heapmin`** (for example, Windows 98), the function returns -1 and sets `errno` to `ENOSYS`.
By default, this function's global state is scoped to the application. To change this behavior, see [Global state in the CRT](../global-state.md).
diff --git a/docs/c-runtime-library/reference/islower-iswlower-islower-l-iswlower-l.md b/docs/c-runtime-library/reference/islower-iswlower-islower-l-iswlower-l.md
index 02dded213e..f95d12c979 100644
--- a/docs/c-runtime-library/reference/islower-iswlower-islower-l-iswlower-l.md
+++ b/docs/c-runtime-library/reference/islower-iswlower-islower-l-iswlower-l.md
@@ -1,14 +1,13 @@
---
-description: "Learn more about: islower, iswlower, _islower_l, _iswlower_l"
title: "islower, iswlower, _islower_l, _iswlower_l"
-ms.date: "4/2/2020"
+description: "Learn more about: islower, iswlower, _islower_l, _iswlower_l"
+ms.date: 4/2/2020
api_name: ["iswlower", "_islower_l", "islower", "_iswlower_l", "_o_islower", "_o_iswlower"]
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-ms-win-crt-string-l1-1-0.dll", "ntoskrnl.exe"]
api_type: ["DLLExport"]
topic_type: ["apiref"]
f1_keywords: ["_istlower", "islower", "_ismbclower_l", "_liswlower_l", "_istlower_l", "_iswlower_l", "_islower _l", "_islower_l", "iswlower"]
helpviewer_keywords: ["_islower _l function", "_ismbclower_l function", "islower function", "_iswlower_l function", "_liswlower_l function", "_istlower_l function", "istlower function", "_istlower function", "iswlower function", "_islower_l function"]
-ms.assetid: fcc3b70a-2b47-45fd-944d-e5c1942e6457
---
# `islower`, `iswlower`, `_islower_l`, `_iswlower_l`
@@ -54,7 +53,7 @@ The behavior of **`islower`** and **`_islower_l`** is undefined if *`c`* isn't E
| TCHAR.H routine | `_UNICODE` and `_MBCS` not defined | `_MBCS` defined | `_UNICODE` defined |
|---|---|---|---|
| `_istlower` | **`islower`** | [`_ismbclower`](ismbclower-ismbclower-l-ismbcupper-ismbcupper-l.md) | **`iswlower`** |
-| **`_istlower_l`** | `_islower _l` | [`_ismbclower_l`](ismbclower-ismbclower-l-ismbcupper-ismbcupper-l.md) | **`_liswlower_l`** |
+| **`_istlower_l`** | `_islower_l` | [`_ismbclower_l`](ismbclower-ismbclower-l-ismbcupper-ismbcupper-l.md) | **`_liswlower_l`** |
## Remarks
@@ -64,10 +63,10 @@ By default, this function's global state is scoped to the application. To change
| Routine | Required header |
|---|---|
-| **`islower`** | \ |
-| **`iswlower`** | \ or \ |
-| **`_islower_l`** | \ |
-| **`_swlower_l`** | \ or \ |
+| **`islower`** | `` |
+| **`iswlower`** | `` or `` |
+| **`_islower_l`** | `` |
+| **`_swlower_l`** | `` or `` |
For more compatibility information, see [Compatibility](../compatibility.md).
diff --git a/docs/c-runtime-library/reference/itoa-itow.md b/docs/c-runtime-library/reference/itoa-itow.md
index 48046135b6..1f03714208 100644
--- a/docs/c-runtime-library/reference/itoa-itow.md
+++ b/docs/c-runtime-library/reference/itoa-itow.md
@@ -8,7 +8,6 @@ api_type: ["DLLExport"]
topic_type: ["apiref"]
f1_keywords: ["_itoa", "_ltoa", "_ultoa", "_i64toa", "_ui64toa", "_itow", "_ltow", "_ultow", "_i64tow", "_ui64tow", "itoa", "ltoa", "ultoa", "i64toa", "ui64toa", "itow", "ltow", "ultow", "i64tow", "ui64tow", "itot", "_itot", "ltot", "_ltot", "ultot", "_ultot", "i64tot", "_i64tot", "ui64tot", "_ui64tot", "_MAX_ITOSTR_BASE16_COUNT", "_MAX_ITOSTR_BASE10_COUNT", "_MAX_ITOSTR_BASE8_COUNT", "_MAX_ITOSTR_BASE2_COUNT", "_MAX_LTOSTR_BASE16_COUNT", "_MAX_LTOSTR_BASE10_COUNT", "_MAX_LTOSTR_BASE8_COUNT", "_MAX_LTOSTR_BASE2_COUNT", "_MAX_ULTOSTR_BASE16_COUNT", "_MAX_ULTOSTR_BASE10_COUNT", "_MAX_ULTOSTR_BASE8_COUNT", "_MAX_ULTOSTR_BASE2_COUNT", "_MAX_I64TOSTR_BASE16_COUNT", "_MAX_I64TOSTR_BASE10_COUNT", "_MAX_I64TOSTR_BASE8_COUNT", "_MAX_I64TOSTR_BASE2_COUNT", "_MAX_U64TOSTR_BASE16_COUNT", "_MAX_U64TOSTR_BASE10_COUNT", "_MAX_U64TOSTR_BASE8_COUNT", "_MAX_U64TOSTR_BASE2_COUNT"]
helpviewer_keywords: ["_itot function", "ui64toa function", "_ui64toa function", "converting integers", "itot function", "_i64tow function", "_i64toa function", "_itow function", "ui64tow function", "integers, converting", "itoa function", "_ui64tow function", "i64tow function", "itow function", "i64toa function", "converting numbers, to strings", "_itoa function"]
-ms.assetid: 46592a00-77bb-4e73-98c0-bf629d96cea6
---
# `itoa`, `_itoa`, `ltoa`, `_ltoa`, `ultoa`, `_ultoa`, `_i64toa`, `_ui64toa`, `_itow`, `_ltow`, `_ultow`, `_i64tow`, `_ui64tow`
@@ -137,7 +136,7 @@ This example uses a conversion count macro to define a buffer large enough to co
int main()
{
wchar_t buffer[_MAX_U64TOSTR_BASE2_COUNT];
- std:wcout << _ui64tow(0xFFFFFFFFFFFFFFFFull, buffer, 2) << std::endl;
+ std::wcout << _ui64tow(0xFFFFFFFFFFFFFFFFull, buffer, 2) << std::endl;
}
```
diff --git a/docs/c-runtime-library/reference/kbhit.md b/docs/c-runtime-library/reference/kbhit.md
index e4f1f9cfb7..3d89e65caa 100644
--- a/docs/c-runtime-library/reference/kbhit.md
+++ b/docs/c-runtime-library/reference/kbhit.md
@@ -1,6 +1,6 @@
---
-description: "Learn more about: _kbhit"
title: "_kbhit"
+description: "Learn more about: _kbhit"
ms.date: "4/2/2020"
api_name: ["_kbhit", "_o__kbhit"]
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-ms-win-crt-stdio-l1-1-0.dll"]
@@ -8,7 +8,6 @@ api_type: ["DLLExport"]
topic_type: ["apiref"]
f1_keywords: ["_kbhit", "conio/_kbhit"]
helpviewer_keywords: ["keyboard input", "user input, checking for keyboard", "kbhit function", "console", "console, checking", "keyboards, keyboard input", "_kbhit function", "keyboards, checking input"]
-ms.assetid: e82a1cc9-bbec-4150-b678-a7e433220fe4
---
# `_kbhit`
@@ -20,7 +19,6 @@ Checks the console for keyboard input.
## Syntax
```C
-
int _kbhit( void );
```
diff --git a/docs/c-runtime-library/reference/log-logf-log10-log10f.md b/docs/c-runtime-library/reference/log-logf-log10-log10f.md
index 475f466870..4ff277f7b0 100644
--- a/docs/c-runtime-library/reference/log-logf-log10-log10f.md
+++ b/docs/c-runtime-library/reference/log-logf-log10-log10f.md
@@ -122,9 +122,9 @@ Log base 2 of 65536.000000 is 16.000000
## See also
-[Math and floating-point support](../floating-point-support.md) \
-[`exp`, `expf`, `expl`](exp-expf.md) \
-[`_matherr`](matherr.md) \
-[`pow`, `powf`, `powl`](pow-powf-powl.md) \
-[`_CIlog`](../cilog.md) \
-[`_CIlog10`](../cilog10.md)\
+[Math and floating-point support](../floating-point-support.md)\
+[`exp`, `expf`, `expl`](exp-expf.md)\
+[`_matherr`](matherr.md)\
+[`pow`, `powf`, `powl`](pow-powf-powl.md)\
+[`_CIlog`](../cilog.md)\
+[`_CIlog10`](../cilog10.md)
diff --git a/docs/c-runtime-library/reference/longjmp.md b/docs/c-runtime-library/reference/longjmp.md
index e94b1110c1..da78b65d11 100644
--- a/docs/c-runtime-library/reference/longjmp.md
+++ b/docs/c-runtime-library/reference/longjmp.md
@@ -1,6 +1,6 @@
---
-description: "Learn more about: longjmp"
title: "longjmp"
+description: "Learn more about: longjmp"
ms.date: "1/14/2021"
api_name: ["longjmp"]
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", "ntoskrnl.exe"]
@@ -8,7 +8,6 @@ api_type: ["DLLExport"]
topic_type: ["apiref"]
f1_keywords: ["longjmp"]
helpviewer_keywords: ["restoring stack environment and execution locale", "longjmp function"]
-ms.assetid: 0e13670a-5130-45c1-ad69-6862505b7a2f
---
# `longjmp`
@@ -75,5 +74,5 @@ See the example for [`_fpreset`](fpreset.md).
## See also
-[Process and environment control](../process-and-environment-control.md)
+[Process and environment control](../process-and-environment-control.md)\
[`setjmp`](setjmp.md)
diff --git a/docs/c-runtime-library/reference/malloca.md b/docs/c-runtime-library/reference/malloca.md
index 9953a91657..56b67ffeb9 100644
--- a/docs/c-runtime-library/reference/malloca.md
+++ b/docs/c-runtime-library/reference/malloca.md
@@ -1,7 +1,7 @@
---
-description: "Learn more about: _malloca"
title: "_malloca"
-ms.date: "11/04/2016"
+description: "Learn more about: _malloca"
+ms.date: 11/04/2016
api_name: ["_malloca"]
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"]
@@ -38,7 +38,7 @@ If *`size`* is greater than `_ALLOCA_S_THRESHOLD`, then **`_malloca`** attempts
There are restrictions to explicitly calling **`_malloca`** in an exception handler (EH). EH routines that run on x86-class processors operate in their own memory frame: They perform their tasks in memory space that isn't based on the current location of the stack pointer of the enclosing function. The most common implementations include Windows NT structured exception handling (SEH) and C++ catch clause expressions. Therefore, explicitly calling **`_malloca`** in any of the following scenarios results in program failure during the return to the calling EH routine:
-- Windows SEH exception filter expression: **`__except`** (`_malloca ()` )
+- Windows SEH exception filter expression: **`__except`** (`_malloca ()`)
- Windows SEH final exception handler: **`__finally`** {`_malloca ()` }
diff --git a/docs/c-runtime-library/reference/mbbtype-mbbtype-l.md b/docs/c-runtime-library/reference/mbbtype-mbbtype-l.md
index abff8af776..d3e9461cbe 100644
--- a/docs/c-runtime-library/reference/mbbtype-mbbtype-l.md
+++ b/docs/c-runtime-library/reference/mbbtype-mbbtype-l.md
@@ -50,9 +50,9 @@ The locale to use.
|---|---|---|---|
| Any value except 1 | Valid single byte or lead byte | `_MBC_SINGLE` (0) | Single byte (0x20 - 0x7E, 0xA1 - 0xDF) |
| Any value except 1 | Valid single byte or lead byte | `_MBC_LEAD` (1) | Lead byte of multibyte character (0x81 - 0x9F, 0xE0 - 0xFC) |
-| Any value except 1 | Valid single-byte or lead byte | `_MBC_ILLEGAL`
(-1) | Invalid character (any value except 0x20 - 0x7E, 0xA1 - 0xDF, 0x81 - 0x9F, 0xE0 - 0xFC |
+| Any value except 1 | Valid single-byte or lead byte | `_MBC_ILLEGAL` (-1) | Invalid character: not single or lead (0x00 - 0x1F, 0x7F, 0x80, 0xA0, 0xFD, 0xFE, 0xFF) |
| 1 | Valid trail byte | `_MBC_TRAIL` (2) | Trailing byte of multibyte character (0x40 - 0x7E, 0x80 - 0xFC) |
-| 1 | Valid trail byte | `_MBC_ILLEGAL`
(-1) | Invalid character (any value except 0x20 - 0x7E, 0xA1 - 0xDF, 0x81 - 0x9F, 0xE0 - 0xFC |
+| 1 | Valid trail byte | `_MBC_ILLEGAL` (-1) | Invalid character: not trailing (0x00 - 0x3F, 0x7F, 0xFD, 0xFE, 0xFF) |
## Remarks
diff --git a/docs/c-runtime-library/reference/mbrtowc.md b/docs/c-runtime-library/reference/mbrtowc.md
index b8634e50a7..7c64576e18 100644
--- a/docs/c-runtime-library/reference/mbrtowc.md
+++ b/docs/c-runtime-library/reference/mbrtowc.md
@@ -1,14 +1,13 @@
---
-description: "Learn more about: mbrtowc"
title: "mbrtowc"
-ms.date: "4/2/2020"
+description: "Learn more about: mbrtowc"
+ms.date: 4/2/2020
api_name: ["mbrtowc", "_o_mbrtowc"]
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-ms-win-crt-convert-l1-1-0.dll"]
api_type: ["DLLExport"]
topic_type: ["apiref"]
f1_keywords: ["mbrtowc"]
helpviewer_keywords: ["mbrtowc function"]
-ms.assetid: a1e87fcc-6de0-4ca1-bf26-508d28490286
---
# `mbrtowc`
@@ -100,7 +99,7 @@ int Sample(char* szIn, wchar_t* wcOut, int nMax)
szLocal = setlocale(LC_ALL, "French_Canada.1252");
if (!szLocal)
{
- printf("The fuction setlocale(LC_ALL, \"French_Canada.1252\") failed!\n");
+ printf("The function setlocale(LC_ALL, \"French_Canada.1252\") failed!\n");
return 1;
}
@@ -110,7 +109,7 @@ int Sample(char* szIn, wchar_t* wcOut, int nMax)
// from a previous call to setlocale.
if (_setmbcp(_MB_CP_SBCS) == -1)
{
- printf("The fuction _setmbcp(_MB_CP_SBCS) failed!");
+ printf("The function _setmbcp(_MB_CP_SBCS) failed!");
return 1;
}
diff --git a/docs/c-runtime-library/reference/mbsnbset-s-mbsnbset-s-l.md b/docs/c-runtime-library/reference/mbsnbset-s-mbsnbset-s-l.md
index 903e87992a..9fa6a973f5 100644
--- a/docs/c-runtime-library/reference/mbsnbset-s-mbsnbset-s-l.md
+++ b/docs/c-runtime-library/reference/mbsnbset-s-mbsnbset-s-l.md
@@ -1,14 +1,13 @@
---
-description: "Learn more about: _mbsnbset_s, _mbsnbset_s_l"
title: "_mbsnbset_s, _mbsnbset_s_l"
-ms.date: "4/2/2020"
+description: "Learn more about: _mbsnbset_s, _mbsnbset_s_l"
+ms.date: 4/2/2020
api_name: ["_mbsnbset_s_l", "_mbsnbset_s", "_o__mbsnbset_s", "_o__mbsnbset_s_l"]
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-ms-win-crt-multibyte-l1-1-0.dll"]
api_type: ["DLLExport"]
topic_type: ["apiref"]
f1_keywords: ["mbsnbset_s", "_mbsnbset_s_l", "_mbsnbset_s", "mbsnbset_s_l"]
helpviewer_keywords: ["tcsnset_s function", "mbsnbset_s function", "mbsnbset_s_l function", "_mbsnbset_s_l function", "_tcsnset_s_l function", "_mbsnbset_s function", "_tcsnset_s function", "tcsnset_s_l function"]
-ms.assetid: 811f92c9-cc31-4bbd-8017-2d1bfc6fb96f
---
# `_mbsnbset_s`, `_mbsnbset_s_l`
@@ -90,14 +89,14 @@ By default, this function's global state is scoped to the application. To change
| Tchar.h routine | `_UNICODE` and `_MBCS` not defined | `_MBCS` defined | `_UNICODE` defined |
|---|---|---|---|
| `_tcsnset_s` | `_strnset_s` | **`_mbsnbset_s`** | `_wcsnset_s` |
-| `_tcsnset_s_l` | `_strnset_s _l` | **`_mbsnbset_s_l`** | `_wcsnset_s_l` |
+| `_tcsnset_s_l` | `_strnset_s_l` | **`_mbsnbset_s_l`** | `_wcsnset_s_l` |
## Requirements
| Routine | Required header |
|---|---|
-| **`_mbsnbset_s`** | \ |
-| **`_mbsnbset_s_l`** | \ |
+| **`_mbsnbset_s`** | `` |
+| **`_mbsnbset_s_l`** | `` |
For more compatibility information, see [Compatibility](../compatibility.md).
diff --git a/docs/c-runtime-library/reference/mkdir-wmkdir.md b/docs/c-runtime-library/reference/mkdir-wmkdir.md
index 43a9a54ba6..f01bf458e6 100644
--- a/docs/c-runtime-library/reference/mkdir-wmkdir.md
+++ b/docs/c-runtime-library/reference/mkdir-wmkdir.md
@@ -1,6 +1,6 @@
---
-description: "Learn more about: _mkdir, _wmkdir"
title: "_mkdir, _wmkdir"
+description: "Learn more about: _mkdir, _wmkdir"
ms.date: "4/2/2020"
api_name: ["_wmkdir", "_mkdir", "_o__mkdir", "_o__wmkdir"]
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-ms-win-crt-filesystem-l1-1-0.dll"]
@@ -8,7 +8,6 @@ api_type: ["DLLExport"]
topic_type: ["apiref"]
f1_keywords: ["_mkdir", "tmkdir", "_tmkdir", "wmkdir", "_wmkdir"]
helpviewer_keywords: ["_wmkdir function", "folders [C++], creating", "wmkdir function", "directories [C++], creating", "mkdir function", "tmkdir function", "_mkdir function", "_tmkdir function"]
-ms.assetid: 7f22d01d-63a5-4712-a6e7-d34878b2d840
---
# `_mkdir`, `_wmkdir`
@@ -17,7 +16,6 @@ Creates a new directory.
## Syntax
```C
-
int _mkdir(
const char *dirname
);
diff --git a/docs/c-runtime-library/reference/msize-dbg.md b/docs/c-runtime-library/reference/msize-dbg.md
index b1edd1a907..01ea05ea49 100644
--- a/docs/c-runtime-library/reference/msize-dbg.md
+++ b/docs/c-runtime-library/reference/msize-dbg.md
@@ -8,7 +8,6 @@ api_type: ["DLLExport"]
topic_type: ["apiref"]
f1_keywords: ["_msize_dbg", "msize_dbg"]
helpviewer_keywords: ["memory blocks", "_msize_dbg function", "msize_dbg function"]
-ms.assetid: a333f4b6-f8a2-4e61-bb69-cb34063b8cef
---
# `_msize_dbg`
@@ -41,13 +40,13 @@ On successful completion, **`_msize_dbg`** returns the size (in bytes) of the sp
For information about how memory blocks are allocated, initialized, and managed in the debug version of the base heap, see [CRT debug heap details](../crt-debug-heap-details.md). For information about the allocation block types and how they're used, see [Types of blocks on the debug heap](../crt-debug-heap-details.md#types-of-blocks-on-the-debug-heap). For information about the differences between standard heap functions and the debug versions, see [Debug versions of heap allocation functions](../debug-versions-of-heap-allocation-functions.md).
-This function validates its parameter. If *`memblock`* is a null pointer, **`_msize_dbg`** invokes an invalid parameter handler, as described in [Parameter validation](../parameter-validation.md). If the error is handled, the function sets `errno` to `EINVAL` and returns -1.
+This function validates its parameter. If *`memblock`* is a null pointer, **`_msize_dbg`** invokes an invalid parameter handler, as described in [Parameter validation](../parameter-validation.md). If the error is handled, the function sets `errno` to `EINVAL` and returns -1 (18,446,744,073,709,551,615 unsigned).
## Requirements
| Routine | Required header |
|---|---|
-| **`_msize_dbg`** | \ |
+| **`_msize_dbg`** | `` |
For more compatibility information, see [Compatibility](../compatibility.md).
diff --git a/docs/c-runtime-library/reference/msize.md b/docs/c-runtime-library/reference/msize.md
index db66cf4361..b5d1cad10b 100644
--- a/docs/c-runtime-library/reference/msize.md
+++ b/docs/c-runtime-library/reference/msize.md
@@ -1,7 +1,7 @@
---
description: "Learn more about: _msize"
title: "_msize"
-ms.date: "4/2/2020"
+ms.date: 07/26/2024
api_name: ["_msize", "_o__msize"]
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-ms-win-crt-heap-l1-1-0.dll"]
api_type: ["DLLExport"]
@@ -36,7 +36,7 @@ The **`_msize`** function returns the size, in bytes, of the memory block alloca
When the application is linked with a debug version of the C run-time libraries, **`_msize`** resolves to [`_msize_dbg`](msize-dbg.md). For more information about how the heap is managed during the debugging process, see [The CRT debug heap](../crt-debug-heap-details.md).
-This function validates its parameter. If *`memblock`* is a `NULL` pointer, **`_msize`** invokes an invalid parameter handler, as described in [Parameter validation](../parameter-validation.md). If the error is handled, the function sets `errno` to `EINVAL` and returns -1.
+This function validates its parameter. If *`memblock`* is a `NULL` pointer, **`_msize`** invokes an invalid parameter handler, as described in [Parameter validation](../parameter-validation.md). If the error is handled, the function sets `errno` to `EINVAL` and returns -1 (18,446,744,073,709,551,615 unsigned).
By default, this function's global state is scoped to the application. To change this behavior, see [Global state in the CRT](../global-state.md).
diff --git a/docs/c-runtime-library/reference/nextafter-functions.md b/docs/c-runtime-library/reference/nextafter-functions.md
index da24da3c06..f4945d818e 100644
--- a/docs/c-runtime-library/reference/nextafter-functions.md
+++ b/docs/c-runtime-library/reference/nextafter-functions.md
@@ -56,7 +56,7 @@ The **`nextafter`** and **`nexttoward`** function families are equivalent, excep
Because C++ allows overloading, if you include `` you can call overloads of **`nextafter`** and **`nexttoward`** that return **`float`** and **`long double`** types. In a C program, unless you're using the `` macro to call this function, **`nextafter`** and **`nexttoward`** always return **`double`**.
-If you use the `nextafter` or `nexttoward`macro from ``, the type of the argument determines which version of the function is selected. See [Type-generic math](../tgmath.md) for details.
+If you use the `nextafter` or `nexttoward` macro from ``, the type of the argument determines which version of the function is selected. See [Type-generic math](../tgmath.md) for details.
The **`_nextafter`** and **`_nextafterf`** functions are Microsoft-specific. The **`_nextafterf`** function is only available when compiling for x64.
diff --git a/docs/c-runtime-library/reference/not-eq.md b/docs/c-runtime-library/reference/not-eq.md
index e89211cb5c..90877cd219 100644
--- a/docs/c-runtime-library/reference/not-eq.md
+++ b/docs/c-runtime-library/reference/not-eq.md
@@ -1,17 +1,16 @@
---
description: "Learn more about: not_eq"
title: "not_eq"
-ms.date: "11/04/2016"
+ms.date: 08/09/2024
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: ["ISO646/not_eq", "not_eq", "std::not_eq", "std.not_eq"]
helpviewer_keywords: ["not_eq function"]
-ms.assetid: d87ad299-8b50-4393-a57f-06f70e1f23fb
---
# `not_eq`
-An alternative to the **`!=`** operator.
+An alternative spelling for the **`!=`** operator.
## Syntax
@@ -21,34 +20,40 @@ An alternative to the **`!=`** operator.
## Remarks
-The macro yields the operator **`!=`**.
+C++:
+- **`not_eq`** can be used as alternative to **`!=`**. The [`/permissive-`](../../build/reference/permissive-standards-conformance.md) or [`/Za`](../../build/reference/za-ze-disable-language-extensions.md) compiler option is required.
+- Including `` or `` is deprecated. You can use the alternative spelling without including any header files.
+- There's no alternative spelling for **`==`**.
+
+C:
+- **`not_eq`** is an alternative spelling for **`!=`**. It is provided as a macro in ``, which you must `#include`.
+- There's no alternative spelling for **`==`**.
## Example
```cpp
-// iso646_not_eq.cpp
// compile with: /EHsc
#include
#include
int main( )
{
- using namespace std;
- int a = 0, b = 1;
-
- if (a != b)
- cout << "a is not equal to b" << endl;
-
- if (a not_eq b)
- cout << "a is not equal to b" << endl;
+ int x = 1, y = 2;
+
+ // not_eq is available in C++ and C
+ // This example is for C++, so no header file is needed to use not_eq
+ // When compiling for C, #include to use not_eq
+ if (x not_eq y)
+ {
+ std::cout << "Not equal\n";
+ }
}
```
```Output
-a is not equal to b
-a is not equal to b
+Not equal
```
## Requirements
-**Header:** \
+**Header:** `` is necessary if you are compiling for C.
\ No newline at end of file
diff --git a/docs/c-runtime-library/reference/not.md b/docs/c-runtime-library/reference/not.md
index 54b1235ef3..a878828337 100644
--- a/docs/c-runtime-library/reference/not.md
+++ b/docs/c-runtime-library/reference/not.md
@@ -1,13 +1,12 @@
---
-description: "Learn more about: not"
title: "not"
+description: "Learn more about: not"
ms.date: "11/04/2016"
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: ["std::not", "std.not", "ISO646/not", "not"]
helpviewer_keywords: ["not function"]
-ms.assetid: d2ddbd5c-33c0-4aff-8961-feac155b4ba1
---
# `not`
@@ -16,7 +15,6 @@ An alternative to the **`!`** operator.
## Syntax
```C
-
#define not !
```
diff --git a/docs/c-runtime-library/reference/or-eq.md b/docs/c-runtime-library/reference/or-eq.md
index f9861186e4..86d34f9fb7 100644
--- a/docs/c-runtime-library/reference/or-eq.md
+++ b/docs/c-runtime-library/reference/or-eq.md
@@ -1,13 +1,12 @@
---
-description: "Learn more about: or_eq"
title: "or_eq"
+description: "Learn more about: or_eq"
ms.date: "11/04/2016"
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: ["std::or_eq", "ISO646/or_eq", "or_eq", "std.or_eq"]
helpviewer_keywords: ["or_eq function"]
-ms.assetid: 1eb92464-ed58-40d8-a30e-f0a6aa2f4318
---
# `or_eq`
@@ -16,7 +15,6 @@ An alternative to the `|=` operator.
## Syntax
```C
-
#define or_eq |=
```
diff --git a/docs/c-runtime-library/reference/putenv-s-wputenv-s.md b/docs/c-runtime-library/reference/putenv-s-wputenv-s.md
index d346ac9f5d..6437099f5c 100644
--- a/docs/c-runtime-library/reference/putenv-s-wputenv-s.md
+++ b/docs/c-runtime-library/reference/putenv-s-wputenv-s.md
@@ -1,8 +1,8 @@
---
description: "Learn more about: _putenv_s, _wputenv_s"
-title: "_putenv_s, _wputenv_s"
+title: "_putenv_s, _wputenv_s, _tputenv_s"
ms.date: "4/2/2020"
-api_name: ["_wputenv_s", "_putenv_s", "_o__putenv_s", "_o__wputenv_s"]
+api_name: ["_wputenv_s", "_putenv_s", "_tputenv_s", "_o__putenv_s", "_o__wputenv_s"]
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-ms-win-crt-environment-l1-1-0.dll"]
api_type: ["DLLExport"]
topic_type: ["apiref"]
@@ -16,7 +16,7 @@ Creates, modifies, or removes environment variables. These functions are version
> [!IMPORTANT]
> This API cannot be used in applications that execute in the Windows Runtime. For more information, see [CRT functions not supported in Universal Windows Platform apps](../../cppcx/crt-functions-not-supported-in-universal-windows-platform-apps.md).
-For `_tputenv_s`, see [Generic-text routine mappings](#generic-text-routine-mappings).
+For `_tputenv_s`, see [Generic-text function mappings](#generic-text-function-mappings).
## Syntax
@@ -58,7 +58,7 @@ The **`_putenv_s`** function adds new environment variables or modifies the valu
By default, this function's global state is scoped to the application. To change this behavior, see [Global state in the CRT](../global-state.md).
-### Generic-text routine mappings
+### Generic-text function mappings
The function in the `tchar.h` column maps to the function in the other columns depending on the character set that is defined at compile time.
diff --git a/docs/c-runtime-library/reference/raise.md b/docs/c-runtime-library/reference/raise.md
index 2b33716eae..e3fe3e05b6 100644
--- a/docs/c-runtime-library/reference/raise.md
+++ b/docs/c-runtime-library/reference/raise.md
@@ -14,7 +14,7 @@ helpviewer_keywords: ["signals, sending to executing programs", "raise function"
Sends a signal to the executing program.
> [!NOTE]
-> Do not use this method to shut down a Microsoft Store app, except in testing or debugging scenarios. Programmatic or UI ways to close a Store app are not permitted according to the [Microsoft Store policies](/legal/windows/agreements/store-policies). For more information, see [UWP app lifecycle](/windows/uwp/launch-resume/app-lifecycle).
+> Do not use this method to shut down a Microsoft Store app, except in testing or debugging scenarios. Programmatic or UI ways to close a Store app are not permitted according to the [Microsoft Store policies](/windows/apps/publish/store-policies). For more information, see [UWP app lifecycle](/windows/uwp/launch-resume/app-lifecycle).
## Syntax
diff --git a/docs/c-runtime-library/reference/recalloc.md b/docs/c-runtime-library/reference/recalloc.md
index 2e10f1ee09..09cd09dea3 100644
--- a/docs/c-runtime-library/reference/recalloc.md
+++ b/docs/c-runtime-library/reference/recalloc.md
@@ -1,6 +1,6 @@
---
-description: "Learn more about: _recalloc"
title: "_recalloc"
+description: "Learn more about: _recalloc"
ms.date: "4/2/2020"
api_name: ["_recalloc", "_o__recalloc"]
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-ms-win-crt-heap-l1-1-0.dll"]
@@ -8,7 +8,6 @@ api_type: ["DLLExport"]
topic_type: ["apiref"]
f1_keywords: ["_recalloc", "recalloc"]
helpviewer_keywords: ["_recalloc function", "recalloc function"]
-ms.assetid: 1db8305a-3f03-418c-8844-bf9149f63046
---
# `_recalloc`
@@ -18,7 +17,7 @@ A combination of `realloc` and `calloc`. Reallocates an array in memory and init
```C
void *_recalloc(
- void *memblock
+ void *memblock,
size_t num,
size_t size
);
diff --git a/docs/c-runtime-library/reference/remquo-remquof-remquol.md b/docs/c-runtime-library/reference/remquo-remquof-remquol.md
index 9aa9613702..f6236f9679 100644
--- a/docs/c-runtime-library/reference/remquo-remquof-remquol.md
+++ b/docs/c-runtime-library/reference/remquo-remquof-remquol.md
@@ -8,7 +8,6 @@ api_type: ["DLLExport"]
topic_type: ["apiref"]
f1_keywords: ["remquof", "remquol", "remquo"]
helpviewer_keywords: ["remquol function", "remquof function", "remquo function"]
-ms.assetid: a1d3cb8b-8027-4cd3-8deb-04eb17f299fc
---
# `remquo`, `remquof`, `remquol`
@@ -43,7 +42,7 @@ A pointer to an integer to store a value that has the sign and approximate magni
## Remarks
-The **`remquo`** function calculates the floating-point remainder `f` of *`x`* / *`y`* such that *`x`* = `n` \* *`y`* + `f`*, where `n` is an integer, `f` has the same sign as *`x`*, and the absolute value of `f` is less than the absolute value of *`y`*.
+The **`remquo`** function calculates the floating-point remainder `f` of *`x`* / *`y`* such that *`x`* = `n` \* *`y`* + *`f`*, where `n` is an integer, `f` has the same sign as *`x`*, and the absolute value of `f` is less than the absolute value of *`y`*.
C++ allows overloading, so you can call overloads of **`remquo`** that take and return **`float`** or **`long double`** values. In a C program, unless you're using the \ macro to call this function, **`remquo`** always takes two **`double`** arguments and returns a **`double`**.
diff --git a/docs/c-runtime-library/reference/rmtmp.md b/docs/c-runtime-library/reference/rmtmp.md
index 857dc4c035..7fac6abd1a 100644
--- a/docs/c-runtime-library/reference/rmtmp.md
+++ b/docs/c-runtime-library/reference/rmtmp.md
@@ -1,6 +1,6 @@
---
-description: "Learn more about: _rmtmp"
title: "_rmtmp"
+description: "Learn more about: _rmtmp"
ms.date: "4/2/2020"
api_name: ["_rmtmp", "_o__rmtmp"]
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-ms-win-crt-stdio-l1-1-0.dll"]
@@ -8,7 +8,6 @@ api_type: ["DLLExport"]
topic_type: ["apiref"]
f1_keywords: ["_rmtmp"]
helpviewer_keywords: ["removing temporary files", "_rmtmp function", "files [C++], temporary", "rmtmp function", "files [C++], removing", "temporary files [C++], removing"]
-ms.assetid: 7419501e-2587-4f2a-b469-0dca07f84736
---
# `_rmtmp`
@@ -17,7 +16,6 @@ Removes temporary files.
## Syntax
```C
-
int _rmtmp( void );
```
diff --git a/docs/c-runtime-library/reference/rotl-rotl64-rotr-rotr64.md b/docs/c-runtime-library/reference/rotl-rotl64-rotr-rotr64.md
index dfdbaae96f..c095e8cada 100644
--- a/docs/c-runtime-library/reference/rotl-rotl64-rotr-rotr64.md
+++ b/docs/c-runtime-library/reference/rotl-rotl64-rotr-rotr64.md
@@ -8,7 +8,6 @@ api_type: ["DLLExport"]
topic_type: ["apiref"]
f1_keywords: ["_rotr64", "rotl64", "_rotl64", "rotr64", "rotr", "_rotr", "_rotl", "rotl"]
helpviewer_keywords: ["rotl64 function", "_rotl function", "rotr function", "rotr64 function", "_rotr function", "rotl function", "_rotl64 function", "rotating bits", "_rotr64 function", "bits, rotating"]
-ms.assetid: cfce439b-366f-4584-8ab1-d527b13fcfc6
---
# `_rotl`, `_rotl64`, `_rotr`, `_rotr64`
@@ -17,7 +16,6 @@ Rotates bits to the left (**`_rotl`**) or right (**`_rotr`**).
## Syntax
```C
-
unsigned int _rotl(
unsigned int value,
int shift
diff --git a/docs/c-runtime-library/reference/rtc-numerrors.md b/docs/c-runtime-library/reference/rtc-numerrors.md
index d512c8f402..f2428d8e7a 100644
--- a/docs/c-runtime-library/reference/rtc-numerrors.md
+++ b/docs/c-runtime-library/reference/rtc-numerrors.md
@@ -1,6 +1,6 @@
---
-description: "Learn more about: _RTC_NumErrors"
title: "_RTC_NumErrors"
+description: "Learn more about: _RTC_NumErrors"
ms.date: "11/04/2016"
api_name: ["_RTC_NumErrors"]
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"]
@@ -8,7 +8,6 @@ api_type: ["DLLExport"]
topic_type: ["apiref"]
f1_keywords: ["_RTC_NumErrors", "RTC_NumErrors"]
helpviewer_keywords: ["run-time errors", "_RTC_NumErrors function", "RTC_NumErrors function"]
-ms.assetid: 7e82adae-38e2-4f8b-bc0b-37bda8109fd1
---
# `_RTC_NumErrors`
@@ -17,7 +16,6 @@ Returns the total number of errors that can be detected by run-time error checks
## Syntax
```C
-
int _RTC_NumErrors( void );
```
diff --git a/docs/c-runtime-library/reference/set-abort-behavior.md b/docs/c-runtime-library/reference/set-abort-behavior.md
index 1abfb48f28..957edb7430 100644
--- a/docs/c-runtime-library/reference/set-abort-behavior.md
+++ b/docs/c-runtime-library/reference/set-abort-behavior.md
@@ -14,7 +14,7 @@ helpviewer_keywords: ["aborting programs", "_set_abort_behavior function", "set_
Specifies the action to be taken when a program is abnormally terminated.
> [!NOTE]
-> Do not use the [`abort`](abort.md) function to shut down a Microsoft Store app, except in testing or debugging scenarios. Programmatic or UI ways to close a Store app are not permitted according to the [Microsoft Store policies](/legal/windows/agreements/store-policies). For more information, see [UWP app lifecycle](/windows/uwp/launch-resume/app-lifecycle).
+> Do not use the [`abort`](abort.md) function to shut down a Microsoft Store app, except in testing or debugging scenarios. Programmatic or UI ways to close a Store app are not permitted according to the [Microsoft Store policies](/windows/apps/publish/store-policies). For more information, see [UWP app lifecycle](/windows/uwp/launch-resume/app-lifecycle).
## Syntax
diff --git a/docs/c-runtime-library/reference/signal.md b/docs/c-runtime-library/reference/signal.md
index a9c623188f..ad4bd650a1 100644
--- a/docs/c-runtime-library/reference/signal.md
+++ b/docs/c-runtime-library/reference/signal.md
@@ -14,7 +14,7 @@ helpviewer_keywords: ["signal function"]
Sets interrupt signal handling.
> [!IMPORTANT]
-> Do not use this method to shut down a Microsoft Store app, except in testing or debugging scenarios. Programmatic or UI ways to close a Store app are not permitted according to the [Microsoft Store policies](/legal/windows/agreements/store-policies). For more information, see [UWP app lifecycle](/windows/uwp/launch-resume/app-lifecycle).
+> Do not use this method to shut down a Microsoft Store app, except in testing or debugging scenarios. Programmatic or UI ways to close a Store app are not permitted according to the [Microsoft Store policies](/windows/apps/publish/store-policies). For more information, see [UWP app lifecycle](/windows/uwp/launch-resume/app-lifecycle).
## Syntax
diff --git a/docs/c-runtime-library/reference/snprintf-snprintf-snprintf-l-snwprintf-snwprintf-l.md b/docs/c-runtime-library/reference/snprintf-snprintf-snprintf-l-snwprintf-snwprintf-l.md
index 6adfc17e2e..6043ec459e 100644
--- a/docs/c-runtime-library/reference/snprintf-snprintf-snprintf-l-snwprintf-snwprintf-l.md
+++ b/docs/c-runtime-library/reference/snprintf-snprintf-snprintf-l-snwprintf-snwprintf-l.md
@@ -120,7 +120,7 @@ See [Behavior summary](#behavior-summary) for details.
## Remarks
-Beginning with the UCRT in Visual Studio 2015 and Windows 10, **`snprintf`** is no longer identical to **`_snprintf`**. The **`snprintf`** behavior is now C99 standard conformant. The difference is that if you run out of buffer, `snprintf` null-terminates the end of the buffer and returns the number of characters that would have been required whereas `_snprintf` doesn't null-terminate the buffer and returns -1. Also, `snprintf()` includes one more character in the output because it doesn't null-terminate the buffer.
+Beginning with the UCRT in Visual Studio 2015 and Windows 10, **`snprintf`** is no longer identical to **`_snprintf`**. The **`snprintf`** behavior is now C99 standard conformant. The difference is that if you run out of buffer, `snprintf` null-terminates the end of the buffer and returns the number of characters that would have been required whereas `_snprintf` doesn't null-terminate the buffer and returns -1. Also, `_snprintf()` includes one more character in the output because it doesn't null-terminate the buffer.
- **`snprintf`** and the **`_snprintf`** family of functions format and store *`count`* or fewer characters in *`buffer`*.
- **`snprintf`** always stores a terminating `NULL` character, truncating the output if necessary.
diff --git a/docs/c-runtime-library/reference/sopen-s-wsopen-s.md b/docs/c-runtime-library/reference/sopen-s-wsopen-s.md
index 3b1480c69a..04f2bd984a 100644
--- a/docs/c-runtime-library/reference/sopen-s-wsopen-s.md
+++ b/docs/c-runtime-library/reference/sopen-s-wsopen-s.md
@@ -1,6 +1,6 @@
---
-description: "Learn more about: _sopen_s, _wsopen_s"
title: "_sopen_s, _wsopen_s"
+description: "Learn more about: _sopen_s, _wsopen_s"
ms.date: 05/18/2022
api_name: ["_sopen_s", "_wsopen_s", "_o__sopen_s", "_o__wsopen_s"]
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-ms-win-crt-stdio-l1-1-0.dll"]
@@ -8,7 +8,6 @@ api_type: ["DLLExport"]
topic_type: ["apiref"]
f1_keywords: ["CORECRT_IO/_sopen_s", "CORECRT_WIO/_wsopen_s", "TCHAR/_tsopen_s", "_sopen_s", "_wsopen_s", "_tsopen_s", "sopen_s", "wsopen_s"]
helpviewer_keywords: ["sopen_s function", "_wsopen_s function", "wsopen_s function", "opening files, for sharing", "files [C++], opening", "_sopen_s function", "files [C++], sharing"]
-ms.assetid: 059a0084-d08c-4973-9174-55e391b72aa2
---
# `_sopen_s`, `_wsopen_s`
@@ -29,7 +28,7 @@ errno_t _wsopen_s(
const wchar_t *filename,
int oflag,
int shflag,
- int pmode,
+ int pmode
);
```
diff --git a/docs/c-runtime-library/reference/splitpath-wsplitpath.md b/docs/c-runtime-library/reference/splitpath-wsplitpath.md
index 7f0a8c3122..f11ecc1e6d 100644
--- a/docs/c-runtime-library/reference/splitpath-wsplitpath.md
+++ b/docs/c-runtime-library/reference/splitpath-wsplitpath.md
@@ -1,6 +1,6 @@
---
-description: "Learn more about: _splitpath, _wsplitpath"
title: "_splitpath, _wsplitpath"
+description: "Learn more about: _splitpath, _wsplitpath"
ms.date: 11/30/2023
api_name: ["_wsplitpath", "_splitpath", "_o__splitpath", "_o__wsplitpath"]
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-ms-win-crt-filesystem-l1-1-0.dll"]
@@ -41,7 +41,7 @@ Full path.
Drive letter, followed by a colon (**:**). You can pass `NULL` for this parameter if you don't need the drive letter.
*`dir`*\
-Directory path, including trailing slash. Forward slashes ( `/` ), backslashes ( `\` ), or both may be used. Pass `NULL` for this parameter if you don't need the directory path.
+Directory path, including trailing slash. Forward slashes (`/`), backslashes (`\`), or both may be used. Pass `NULL` for this parameter if you don't need the directory path.
*`fname`*\
Base filename (no extension). Pass `NULL` for this parameter if you don't need the filename.
diff --git a/docs/c-runtime-library/reference/stat-functions.md b/docs/c-runtime-library/reference/stat-functions.md
index 797cf701fc..b1a5efc58f 100644
--- a/docs/c-runtime-library/reference/stat-functions.md
+++ b/docs/c-runtime-library/reference/stat-functions.md
@@ -1,6 +1,6 @@
---
-description: "Learn more about: _stat, _stat32, _stat64, _stati64, _stat32i64, _stat64i32, _wstat, _wstat32, _wstat64, _wstati64, _wstat32i64, _wstat64i32"
title: "_stat, _stat32, _stat64, _stati64, _stat32i64, _stat64i32, _wstat, _wstat32, _wstat64, _wstati64, _wstat32i64, _wstat64i32"
+description: "Learn more about: _stat, _stat32, _stat64, _stati64, _stat32i64, _stat64i32, _wstat, _wstat32, _wstat64, _wstati64, _wstat32i64, _wstat64i32"
ms.date: "5/25/2023"
api_name: ["_wstat64", "_stati64", "_stat32", "_stat32i64", "_stat", "_wstati64", "_wstat32", "_wstat64i32", "_wstat", "_stat64", "_stat64i32", "_wstat32i64", "_o__stat32", "_o__stat32i64", "_o__stat64", "_o__stat64i32", "_o__wstat32", "_o__wstat32i64", "_o__wstat64", "_o__wstat64i32"]
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-ms-win-crt-filesystem-l1-1-0.dll"]
@@ -94,7 +94,7 @@ Variations of these functions support 32-bit or 64-bit time types, and 32-bit or
> [!NOTE]
> **`_wstat`** does not work with Windows Vista symbolic links. In these cases, **`_wstat`** will always report a file size of 0. **`_stat`** does work correctly with symbolic links.
-> The `_stat`family of functions use `CreateFile` in Visual Studio 2015, instead of `FindFirstFile` as in Visual Studio 2013 and earlier. This means that `_stat` on a path ending with a slash succeeds if the path refers to a directory, as opposed to before when the function would error with `errno` set to `ENOENT`.
+> The `_stat` family of functions use `CreateFile` in Visual Studio 2015, instead of `FindFirstFile` as in Visual Studio 2013 and earlier. This means that `_stat` on a path ending with a slash succeeds if the path refers to a directory, as opposed to before when the function would error with `errno` set to `ENOENT`.
This function validates its parameters. If either *`path`* or *`buffer`* is `NULL`, the invalid parameter handler is invoked, as described in [Parameter validation](../parameter-validation.md).
diff --git a/docs/c-runtime-library/reference/strncnt-wcsncnt-mbsnbcnt-mbsnbcnt-l-mbsnccnt-mbsnccnt-l.md b/docs/c-runtime-library/reference/strncnt-wcsncnt-mbsnbcnt-mbsnbcnt-l-mbsnccnt-mbsnccnt-l.md
index 4ca437d019..2c9cdcfed2 100644
--- a/docs/c-runtime-library/reference/strncnt-wcsncnt-mbsnbcnt-mbsnbcnt-l-mbsnccnt-mbsnccnt-l.md
+++ b/docs/c-runtime-library/reference/strncnt-wcsncnt-mbsnbcnt-mbsnbcnt-l-mbsnccnt-mbsnccnt-l.md
@@ -1,6 +1,6 @@
---
-description: "Learn more about: _strncnt, _wcsncnt, _mbsnbcnt, _mbsnbcnt_l, _mbsnccnt, _mbsnccnt_l"
title: "_strncnt, _wcsncnt, _mbsnbcnt, _mbsnbcnt_l, _mbsnccnt, _mbsnccnt_l"
+description: "Learn more about: _strncnt, _wcsncnt, _mbsnbcnt, _mbsnbcnt_l, _mbsnccnt, _mbsnccnt_l"
ms.date: "4/2/2020"
api_name: ["_mbsnbcnt_l", "_mbsnccnt", "_wcsncnt", "_strncnt", "_mbsnccnt_l", "_mbsnbcnt", "_o__mbsnbcnt", "_o__mbsnbcnt_l", "_o__mbsnccnt", "_o__mbsnccnt_l"]
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-ms-win-crt-multibyte-l1-1-0.dll"]
@@ -8,7 +8,6 @@ api_type: ["DLLExport"]
topic_type: ["apiref"]
f1_keywords: ["_mbsnbcnt", "wcsncnt", "_tcsnbcnt", "_mbsnccnt", "_ftcsnbcnt", "mbsnbcnt", "strncnt", "mbsnbcnt_l", "mbsnccnt_l", "mbsnccnt", "_strncnt", "_wcsncnt"]
helpviewer_keywords: ["_strncnt function", "_mbsnbcnt function", "_mbsnbcnt_l function", "_mbsnccnt_l function", "mbsnbcnt_l function", "mbsnbcnt function", "tcsnbcnt function", "mbsnccnt_l function", "strncnt function", "_tcsnbcnt function", "mbsnccnt function", "wcsncnt function", "_mbsnccnt function", "_wcsncnt function"]
-ms.assetid: 2a022e9e-a307-4acb-a66b-e56e5357f848
---
# `_strncnt`, `_wcsncnt`, `_mbsnbcnt`, `_mbsnbcnt_l`, `_mbsnccnt`, `_mbsnccnt_l`
@@ -105,8 +104,8 @@ For more compatibility information, see [Compatibility](../compatibility.md).
```C
// crt_mbsnbcnt.c
-#include
-#include
+#include
+#include
int main( void )
{
diff --git a/docs/c-runtime-library/reference/strncpy-s-strncpy-s-l-wcsncpy-s-wcsncpy-s-l-mbsncpy-s-mbsncpy-s-l.md b/docs/c-runtime-library/reference/strncpy-s-strncpy-s-l-wcsncpy-s-wcsncpy-s-l-mbsncpy-s-mbsncpy-s-l.md
index eb83a03d02..784bbae4d5 100644
--- a/docs/c-runtime-library/reference/strncpy-s-strncpy-s-l-wcsncpy-s-wcsncpy-s-l-mbsncpy-s-mbsncpy-s-l.md
+++ b/docs/c-runtime-library/reference/strncpy-s-strncpy-s-l-wcsncpy-s-wcsncpy-s-l-mbsncpy-s-mbsncpy-s-l.md
@@ -1,22 +1,22 @@
---
description: "Learn more about: strncpy_s, _strncpy_s_l, wcsncpy_s, _wcsncpy_s_l, _mbsncpy_s, _mbsncpy_s_l"
-title: "strncpy_s, _strncpy_s_l, wcsncpy_s, _wcsncpy_s_l, _mbsncpy_s, _mbsncpy_s_l"
+title: "strncpy_s, _strncpy_s_l, wcsncpy_s, _wcsncpy_s_l, _mbsncpy_s, _mbsncpy_s_l, _tcsncpy_s, _tcsncpy_s_l, _tcsnccpy_s, _tcsnccpy_s_l"
ms.date: "4/2/2020"
-api_name: ["_mbsncpy_s_l", "wcsncpy_s", "_strncpy_s_l", "strncpy_s", "_mbsncpy_s", "_wcsncpy_s_l", "_o__mbsncpy_s", "_o__mbsncpy_s_l", "_o_strncpy_s", "_o_wcsncpy_s"]
+api_name: ["_mbsncpy_s_l", "wcsncpy_s", "_strncpy_s_l", "strncpy_s", "_mbsncpy_s", "_wcsncpy_s_l", "_o__mbsncpy_s", "_o__mbsncpy_s_l", "_o_strncpy_s", "_o_wcsncpy_s", "_tcsnccpy_s", "_tcsnccpy_s_l", "_tcsncpy_s", "_tcsncpy_s_l"]
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-ms-win-crt-multibyte-l1-1-0.dll", "api-ms-win-crt-string-l1-1-0.dll", "ntoskrnl.exe"]
api_type: ["DLLExport"]
topic_type: ["apiref"]
f1_keywords: ["_tcsncpy_s", "_wcsncpy_s_l", "strncpy_s", "_strncpy_s_l", "wcsncpy_s", "_tcsncpy_s_l", "_tcsnccpy_s", "_tcsnccpy_s_l"]
helpviewer_keywords: ["_wcsncpy_s_l function", "_mbsnbcpy_s function", "_tcsncpy_s_l function", "mbsncpy_s function", "strncpy_s_l function", "_strncpy_s_l function", "strncpy_s function", "mbsncpy_s_l function", "wcsncpy_s function", "_tcsnccpy_s function", "copying strings", "strings [C++], copying", "_mbsnbcpy_s_l function", "_tcsncpy_s function", "wcsncpy_s_l function", "_tcsnccpy_s_l function"]
---
-# `strncpy_s`, `_strncpy_s_l`, `wcsncpy_s`, `_wcsncpy_s_l`, `_mbsncpy_s`, `_mbsncpy_s_l`, `_tcsnccpy_s`, `_tcsnccpy_s_l`
+# `strncpy_s`, `_strncpy_s_l`, `wcsncpy_s`, `_wcsncpy_s_l`, `_mbsncpy_s`, `_mbsncpy_s_l`, `_tcsncpy_s`, `_tcsncpy_s_l`, `_tcsnccpy_s`, `_tcsnccpy_s_l`
Copies characters of one string to another. These versions of [`strncpy`, `_strncpy_l`, `wcsncpy`, `_wcsncpy_l`, `_mbsncpy`, `_mbsncpy_l`](strncpy-strncpy-l-wcsncpy-wcsncpy-l-mbsncpy-mbsncpy-l.md) have security enhancements, as described in [Security features in the CRT](../security-features-in-the-crt.md).
> [!IMPORTANT]
> **`_mbsncpy_s`** and **`_mbsncpy_s_l`** cannot be used in applications that execute in the Windows Runtime. For more information, see [CRT functions not supported in Universal Windows Platform apps](../../cppcx/crt-functions-not-supported-in-universal-windows-platform-apps.md).
-For `_tcsnccpy_s` and `_tcsnccpy_s_l`, see [Generic-text routine mappings](#generic-text-routine-mappings).
+For `_tcsnccpy_s`, `_tcsnccpy_s_l`, `_tcsnccpy_s`, and `_tcsnccpy_s_l` see [Generic-text function mappings](#generic-text-function-mappings).
## Syntax
@@ -169,7 +169,7 @@ The debug library versions of these functions first fill the buffer with 0xFE. T
By default, this function's global state is scoped to the application. To change this behavior, see [Global state in the CRT](../global-state.md).
-### Generic-text routine mappings
+### Generic-text function mappings
The function in the `tchar.h` column maps to the function in the other columns depending on the character set that is defined at compile time.
diff --git a/docs/c-runtime-library/reference/strnset-s-strnset-s-l-wcsnset-s-wcsnset-s-l-mbsnset-s-mbsnset-s-l.md b/docs/c-runtime-library/reference/strnset-s-strnset-s-l-wcsnset-s-wcsnset-s-l-mbsnset-s-mbsnset-s-l.md
index a377069722..e7d55e8de2 100644
--- a/docs/c-runtime-library/reference/strnset-s-strnset-s-l-wcsnset-s-wcsnset-s-l-mbsnset-s-mbsnset-s-l.md
+++ b/docs/c-runtime-library/reference/strnset-s-strnset-s-l-wcsnset-s-wcsnset-s-l-mbsnset-s-mbsnset-s-l.md
@@ -1,22 +1,22 @@
---
description: "Learn more about: _strnset_s, _strnset_s_l, _wcsnset_s, _wcsnset_s_l, _mbsnset_s, _mbsnset_s_l"
-title: "_strnset_s, _strnset_s_l, _wcsnset_s, _wcsnset_s_l, _mbsnset_s, _mbsnset_s_l"
+title: "_strnset_s, _strnset_s_l, _wcsnset_s, _wcsnset_s_l, _mbsnset_s, _mbsnset_s_l, _tcsnset_s, _tcsncset_s, _tcsncset_s_l"
ms.date: "4/2/2020"
-api_name: ["_mbsnset_s_l", "_strnset_s", "_mbsnset_s", "_strnset_s_l", "_wcsnset_s_l", "_wcsnset_s", "_o__mbsnset_s", "_o__mbsnset_s_l", "_o__strnset_s", "_o__wcsnset_s"]
+api_name: ["_mbsnset_s_l", "_strnset_s", "_mbsnset_s", "_strnset_s_l", "_wcsnset_s_l", "_wcsnset_s", "_o__mbsnset_s", "_o__mbsnset_s_l", "_o__strnset_s", "_o__wcsnset_s", "_tcsncset_s", "_tcsncset_s_l", "_tcsnset_s"]
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-ms-win-crt-multibyte-l1-1-0.dll", "api-ms-win-crt-string-l1-1-0.dll", "ntoskrnl.exe"]
api_type: ["DLLExport"]
topic_type: ["apiref"]
-f1_keywords: ["_mbsnset_s_l", "wcsnset_s", "_tcsnset_s_l", "_wcsnset_s", "_mbsnset_s", "_wcsnset_s_l", "_strnset_s_l", "strnset_s_l", "_tcsnset_s", "_strnset_s", "strnset_s", "mbsnset_s_l", "mbsnset_s", "wcsnset_s_l", "_tcsncset_s", "_tcsncset_s_l"]
-helpviewer_keywords: ["tcsnset_s function", "mbsnset_s_l function", "initializing characters", "wcsnset_s function", "mbsnset_s function", "_tcsnset_s_l function", "_strnset_s_l function", "_mbsnset_s function", "strnset_s_l function", "_tcsnset_s function", "_strnset_s function", "tcsnset_s_l function", "_mbsnset_s_l function", "strnset_s function", "_wcsnset_s function", "_tcsncset_s function", "_tcsncset_s_l function"]
+f1_keywords: ["_mbsnset_s_l", "wcsnset_s", "_tcsnset_s", "_tcsnset_s_l", "_wcsnset_s", "_mbsnset_s", "_wcsnset_s_l", "_strnset_s_l", "strnset_s_l", "_strnset_s", "strnset_s", "mbsnset_s_l", "mbsnset_s", "wcsnset_s_l", "_tcsncset_s", "_tcsncset_s_l"]
+helpviewer_keywords: ["tcsnset_s function", "mbsnset_s_l function", "initializing characters", "wcsnset_s function", "mbsnset_s function", "_tcsnset_s function", "_tcsnset_s_l function", "_strnset_s_l function", "_mbsnset_s function", "strnset_s_l function", "_strnset_s function", "tcsnset_s_l function", "_mbsnset_s_l function", "strnset_s function", "_wcsnset_s function", "_tcsncset_s function", "_tcsncset_s_l function"]
---
-# `_strnset_s`, `_strnset_s_l`, `_wcsnset_s`, `_wcsnset_s_l`, `_mbsnset_s`, `_mbsnset_s_l`, `_tcsncset_s`, `_tcsncset_s_l`
+# `_strnset_s`, `_strnset_s_l`, `_wcsnset_s`, `_wcsnset_s_l`, `_mbsnset_s`, `_mbsnset_s_l`, `_tcsnset_s`, `_tcsncset_s`, `_tcsncset_s_l`
Initializes characters of a string to a given character. These versions of [`_strnset`, `_strnset_l`, `_wcsnset`, `_wcsnset_l`, `_mbsnset`, `_mbsnset_l`](strnset-strnset-l-wcsnset-wcsnset-l-mbsnset-mbsnset-l.md) have security enhancements, as described in [Security features in the CRT](../security-features-in-the-crt.md).
> [!IMPORTANT]
> **`_mbsnset_s`** and **`_mbsnset_s_l`** cannot be used in applications that execute in the Windows Runtime. For more information, see [CRT functions not supported in Universal Windows Platform apps](../../cppcx/crt-functions-not-supported-in-universal-windows-platform-apps.md).
-For `_tcsncset_s` and `_tcsncset_s_l`, see [Generic-text routine mappings](#generic-text-routine-mappings).
+For `_tcsnset_s`, `_tcsnset_s_l`, `_tcsncset_s`, and `_tcsncset_s_l` see [Generic-text function mappings](#generic-text-function-mappings).
## Syntax
@@ -97,7 +97,7 @@ The debug library versions of these functions first fill the buffer with `0xFE`.
By default, this function's global state is scoped to the application. To change this behavior, see [Global state in the CRT](../global-state.md).
-### Generic-text routine mappings
+### Generic-text function mappings
The function in the `tchar.h` column maps to the function in the other columns depending on the character set that is defined at compile time.
diff --git a/docs/c-runtime-library/reference/strrchr-wcsrchr-mbsrchr-mbsrchr-l.md b/docs/c-runtime-library/reference/strrchr-wcsrchr-mbsrchr-mbsrchr-l.md
index 90ada77650..9c8d760c68 100644
--- a/docs/c-runtime-library/reference/strrchr-wcsrchr-mbsrchr-mbsrchr-l.md
+++ b/docs/c-runtime-library/reference/strrchr-wcsrchr-mbsrchr-mbsrchr-l.md
@@ -1,6 +1,6 @@
---
-description: "Learn more about: strrchr, wcsrchr, _mbsrchr, _mbsrchr_l"
title: "strrchr, wcsrchr, _mbsrchr, _mbsrchr_l"
+description: "Learn more about: strrchr, wcsrchr, _mbsrchr, _mbsrchr_l"
ms.date: "4/2/2020"
api_name: ["strrchr", "wcsrchr", "_mbsrchr", "_mbsrchr_l", "_o__mbsrchr", "_o__mbsrchr_l"]
api_location: ["msvcrt.dll", "msvcr80.dll", "msvcr90.dll", "msvcr100.dll", "msvcr100_clr0400.dll", "msvcr110.dll", "msvcr110_clr0400.dll", "msvcr120.dll", "msvcr120_clr0400.dll", "ntdll.dll", "ucrtbase.dll", "api-ms-win-crt-multibyte-l1-1-0.dll", "ntoskrnl.exe"]
@@ -131,4 +131,4 @@ For an example of using **`strrchr`**, see [`strchr`](strchr-wcschr-mbschr-mbsch
[`strcspn`, `wcscspn`, `_mbscspn`, `_mbscspn_l`](strcspn-wcscspn-mbscspn-mbscspn-l.md)\
[`_strnicmp`, `_wcsnicmp`, `_mbsnicmp`, `_strnicmp_l`, `_wcsnicmp_l`, `_mbsnicmp_l`](strnicmp-wcsnicmp-mbsnicmp-strnicmp-l-wcsnicmp-l-mbsnicmp-l.md)\
[`strpbrk`, `wcspbrk`, `_mbspbrk`, `_mbspbrk_l`](strpbrk-wcspbrk-mbspbrk-mbspbrk-l.md)\
-[`strspn`, `wcsspn`, `_mbsspn`, `_mbsspn_l`](strspn-wcsspn-mbsspn-mbsspn-l.md)\
+[`strspn`, `wcsspn`, `_mbsspn`, `_mbsspn_l`](strspn-wcsspn-mbsspn-mbsspn-l.md)
diff --git a/docs/c-runtime-library/reference/strtoimax-strtoimax-l-wcstoimax-wcstoimax-l.md b/docs/c-runtime-library/reference/strtoimax-strtoimax-l-wcstoimax-wcstoimax-l.md
index c6bcf88b3f..288b4dcce8 100644
--- a/docs/c-runtime-library/reference/strtoimax-strtoimax-l-wcstoimax-wcstoimax-l.md
+++ b/docs/c-runtime-library/reference/strtoimax-strtoimax-l-wcstoimax-wcstoimax-l.md
@@ -1,14 +1,13 @@
---
-description: "Learn more about: strtoimax, _strtoimax_l, wcstoimax, _wcstoimax_l"
title: "strtoimax, _strtoimax_l, wcstoimax, _wcstoimax_l"
-ms.date: "11/04/2016"
+description: "Learn more about: strtoimax, _strtoimax_l, wcstoimax, _wcstoimax_l"
+ms.date: 11/04/2016
api_name: ["wcstoimax", "_wcstoimax_l", "_strtoimax_l", "strtoimax"]
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-ms-win-crt-convert-l1-1-0.dll"]
api_type: ["DLLExport"]
topic_type: ["apiref"]
f1_keywords: ["wcstoimax", "_tcstoimax", "strtoimax", "_wcstoimax_l", "_strtoimax_l", "_tcstoimax_l"]
-helpviewer_keywords: ["strtoimax funciton", "conversion functions", "_strtoimax_l function", "_wcstoimax_l function", "wcstoimax function"]
-ms.assetid: 4530d3dc-aaac-4a76-b7cf-29ae3c98d0ae
+helpviewer_keywords: ["strtoimax function", "conversion functions", "_strtoimax_l function", "_wcstoimax_l function", "wcstoimax function"]
---
# `strtoimax`, `_strtoimax_l`, `wcstoimax`, `_wcstoimax_l`
diff --git a/docs/c-runtime-library/reference/vscprintf-p-vscprintf-p-l-vscwprintf-p-vscwprintf-p-l.md b/docs/c-runtime-library/reference/vscprintf-p-vscprintf-p-l-vscwprintf-p-vscwprintf-p-l.md
index c2185baab2..6f6910fcf6 100644
--- a/docs/c-runtime-library/reference/vscprintf-p-vscprintf-p-l-vscwprintf-p-vscwprintf-p-l.md
+++ b/docs/c-runtime-library/reference/vscprintf-p-vscprintf-p-l-vscwprintf-p-vscwprintf-p-l.md
@@ -59,6 +59,9 @@ These functions differ from **`_vscprintf`** and **`_vscwprintf`** only in that
The versions of these functions with the **`_l`** suffix are identical except that they use the locale parameter passed in instead of the current thread locale.
+Return Value is the size of the formatted data. If the function takes a `char` buffer, the size is in bytes. If the function takes a `wchar_t` buffer, the size specifies the number of 16-bit words.
+Characters refer to `char` characters for functions that take a `char` buffer, and to `wchar_t` characters for functions that take a `wchar_t` buffer.
+
If *`format`* is a null pointer, the invalid parameter handler is invoked, as described in [Parameter validation](../parameter-validation.md). If execution is allowed to continue, the functions return -1 and set `errno` to `EINVAL`.
> [!IMPORTANT]
diff --git a/docs/c-runtime-library/reference/vscprintf-vscprintf-l-vscwprintf-vscwprintf-l.md b/docs/c-runtime-library/reference/vscprintf-vscprintf-l-vscwprintf-vscwprintf-l.md
index 080aed3268..ac02613e06 100644
--- a/docs/c-runtime-library/reference/vscprintf-vscprintf-l-vscwprintf-vscwprintf-l.md
+++ b/docs/c-runtime-library/reference/vscprintf-vscprintf-l-vscwprintf-vscwprintf-l.md
@@ -59,6 +59,9 @@ If *`format`* is a null pointer, the invalid parameter handler is invoked, as de
## Remarks
+Return Value is the size of the formatted data. If the function takes a `char` buffer, the size is in bytes. If the function takes a `wchar_t` buffer, the size specifies the number of 16-bit words.
+Characters refer to `char` characters for functions that take a `char` buffer, and to `wchar_t` characters for functions that take a `wchar_t` buffer.
+
Each *`argument`* (if any) is converted according to the corresponding format specification in *`format`*. The format consists of ordinary characters and has the same form and function as the *`format`* argument for [`printf`](printf-printf-l-wprintf-wprintf-l.md).
> [!IMPORTANT]
diff --git a/docs/c-runtime-library/reference/vsnprintf-s-vsnprintf-s-vsnprintf-s-l-vsnwprintf-s-vsnwprintf-s-l.md b/docs/c-runtime-library/reference/vsnprintf-s-vsnprintf-s-vsnprintf-s-l-vsnwprintf-s-vsnwprintf-s-l.md
index 690566a0fc..096bc62882 100644
--- a/docs/c-runtime-library/reference/vsnprintf-s-vsnprintf-s-vsnprintf-s-l-vsnwprintf-s-vsnwprintf-s-l.md
+++ b/docs/c-runtime-library/reference/vsnprintf-s-vsnprintf-s-vsnprintf-s-l-vsnwprintf-s-vsnwprintf-s-l.md
@@ -105,12 +105,14 @@ See [Behavior summary](#behavior-summary) for details.
## Remarks
-**`vsnprintf_s`** is identical to **`_vsnprintf_s`** and is included for conformance to the ANSI standard. **`_vnsprintf`** is retained for backward compatibility.
+Each of these functions takes a pointer to an argument list, then formats and writes up to *`count`* characters of the given data to the memory pointed to by *`buffer`* and appends a terminating `NULL`.
-Each of these functions takes a pointer to an argument list, then formats and writes up to *`count`* characters of the given data to the memory pointed to by *`buffer`* and appends a terminating null.
+In debug builds, the remaining `sizeOfBuffer` bytes following the terminating `NULL` are filled with 'xFE' as described in [`_CrtSetDebugFillThreshold`](crtsetdebugfillthreshold.md).
The versions of these functions with the **`_l`** suffix are identical except that they use the locale parameter passed in instead of the current thread locale.
+**`vsnprintf_s`** is identical to **`_vsnprintf_s`** and is included for conformance to the ANSI standard. **`_vnsprintf`** is retained for backward compatibility.
+
### Behavior summary
For the following table:
@@ -127,6 +129,7 @@ For the following table:
| `buffer == NULL` and `sizeOfBuffer == 0` and `count == 0` | No data is written. | 0 | N/A | No |
| `buffer == NULL` and either `sizeOfBuffer != 0` or `count != 0` | If execution continues after invalid parameter handler executes, sets `errno` and returns a negative value.| -1 | `EINVAL` (22) | Yes |
| `buffer != NULL` and `sizeOfBuffer == 0` | No data is written. If execution continues after invalid parameter handler executes, sets `errno` and returns a negative value. | -1 | `EINVAL` (22) | Yes |
+| `buffer != NULL` and `sizeOfBuffer != 0` and `count == 0` | The buffer is `NULL` terminated. | -1 | N/A | No |
| `count == 0`| Doesn't write any data and returns the number of characters that would have been written, not including the terminating `NULL`. | The number of characters that would have been written not including the terminating `NULL`. | N/A | No |
| `count < 0` | Unsafe: the value is treated as unsigned, likely creating a large value that results in overwriting the memory that follows the buffer. | The number of characters written, not including the terminating `NULL`. | N/A | No |
| `count < sizeOfBuffer` and `len <= count` | All of the data is written and a terminating `NULL` is appended. | The number of characters written. | N/A | No |
@@ -144,7 +147,7 @@ For information about these and other error codes, see [`_doserrno`, `errno`, `_
> Starting in Windows 10 version 2004 (build 19041), the `printf` family of functions prints exactly representable floating point numbers according to the IEEE 754 rules for rounding. In previous versions of Windows, exactly representable floating point numbers ending in '5' would always round up. IEEE 754 states that they must round to the closest even digit (also known as "Banker's Rounding"). For example, both `printf("%1.0f", 1.5)` and `printf("%1.0f", 2.5)` should round to 2. Previously, 1.5 would round to 2 and 2.5 would round to 3. This change only affects exactly representable numbers. For example, 2.35 (which, when represented in memory, is closer to 2.35000000000000008) continues to round up to 2.4. Rounding done by these functions now also respects the floating point rounding mode set by [`fesetround`](fegetround-fesetround2.md). Previously, rounding always chose `FE_TONEAREST` behavior. This change only affects programs built using Visual Studio 2019 version 16.2 and later. To use the legacy floating point rounding behavior, link with ['legacy_stdio_float_rounding.obj`](../link-options.md).
> [!NOTE]
-> To ensure that there is room for the terminating null, be sure that *`count`* is strictly less than the buffer length, or use `_TRUNCATE`.
+> To ensure that there is room for the terminating `NULL`, be sure that *`count`* is strictly less than the buffer length, or use `_TRUNCATE`.
In C++, using these functions is simplified by template overloads; the overloads can infer buffer length automatically (eliminating the need to specify a size argument) and they can automatically replace older, non-secure functions with their newer, secure counterparts. For more information, see [Secure template overloads](../secure-template-overloads.md).
@@ -209,4 +212,4 @@ nSize: -1, buff: Hi there!
[`fprintf`, `_fprintf_l`, `fwprintf`, `_fwprintf_l`](fprintf-fprintf-l-fwprintf-fwprintf-l.md)\
[`printf`, `_printf_l`, `wprintf`, `_wprintf_l`](printf-printf-l-wprintf-wprintf-l.md)\
[`sprintf`, `_sprintf_l`, `swprintf`, `_swprintf_l`, `__swprintf_l`](sprintf-sprintf-l-swprintf-swprintf-l-swprintf-l.md)\
-[`va_arg`, `va_copy`, `va_end`, `va_start`](va-arg-va-copy-va-end-va-start.md)
\ No newline at end of file
+[`va_arg`, `va_copy`, `va_end`, `va_start`](va-arg-va-copy-va-end-va-start.md)
diff --git a/docs/c-runtime-library/reference/vsnprintf-vsnprintf-vsnprintf-l-vsnwprintf-vsnwprintf-l.md b/docs/c-runtime-library/reference/vsnprintf-vsnprintf-vsnprintf-l-vsnwprintf-vsnwprintf-l.md
index b4a5f31213..1f94c8f59a 100644
--- a/docs/c-runtime-library/reference/vsnprintf-vsnprintf-vsnprintf-l-vsnwprintf-vsnwprintf-l.md
+++ b/docs/c-runtime-library/reference/vsnprintf-vsnprintf-vsnprintf-l-vsnwprintf-vsnwprintf-l.md
@@ -155,7 +155,8 @@ For the following table:
| Encoding error during formatting | If processing string specifier `s`, `S`, or `Z`, format specification processing stops. | -1 | `EILSEQ` (42) | No |
| Encoding error during formatting | If processing character specifier `c` or `C`, the invalid character is skipped. The number of characters written isn't incremented for the skipped character, nor is any data written for it. Processing the format specification continues after skipping the specifier with the encoding error. | The number of characters written, not including the terminating `NULL`. | `EILSEQ` (42) | No |
| `buffer == NULL` and `count != 0` | If execution continues after invalid parameter handler executes, sets `errno` and returns a negative value.| -1 | `EINVAL` (22) | Yes |
-| `count == 0` | No data is written | The number of characters that would have been written, not including the terminating `NULL`. You can use this result to allocate sufficient buffer space for the string and a terminating `NULL`, and then call the function again to fill the buffer. | N/A | No |
+| `buffer == NULL` and `count == 0` | No data is written | The number of characters that would have been written, not including the terminating `NULL`. You can use this result to allocate sufficient buffer space for the string and a terminating `NULL`, and then call the function again to fill the buffer. | N/A | No |
+| `count == 0` | No data is written | -1 | `ERANGE` (34) | No |
| `count < 0`| Unsafe: the value is treated as unsigned, likely creating a large value that results in overwriting the memory that follows the buffer. | The number of characters written. | N/A | No |
| `count < sizeOfBuffer` and `len <= count` | All of the data is written and a terminating `NULL` is appended. | The number of characters written, not including the terminating `NULL`. | N/A | No |
| `count < sizeOfBuffer` and `len > count` | The first *`count-1`* characters are written followed by a null-terminator. | The number of characters that would have been written had `count` matched the number of characters to output, not including the null-terminator. | N/A | No |
diff --git a/docs/c-runtime-library/reference/vsprintf-p-vsprintf-p-l-vswprintf-p-vswprintf-p-l.md b/docs/c-runtime-library/reference/vsprintf-p-vsprintf-p-l-vswprintf-p-vswprintf-p-l.md
index a5ab73d417..75116027f6 100644
--- a/docs/c-runtime-library/reference/vsprintf-p-vsprintf-p-l-vswprintf-p-vswprintf-p-l.md
+++ b/docs/c-runtime-library/reference/vsprintf-p-vsprintf-p-l-vswprintf-p-vswprintf-p-l.md
@@ -66,7 +66,9 @@ The locale to use.
## Return value
-**`_vsprintf_p`** and **`_vswprintf_p`** return the number of characters written, not including the terminating null character, or a negative value if an output error occurs.
+**`_vsprintf_p`** and **`_vswprintf_p`** return the number of characters written, not including the terminating `NULL` character, or a negative value if an output error occurs.
+If the *`buffer`* is a `NULL` pointer and *`sizeInBytes`* or *`count`* are zero, functions return the number of characters that would have been written not including the terminating `NULL`.
+If the *`buffer`* is valid and *`sizeInBytes`* or *`count`* are zero, returns -1.
## Remarks
@@ -76,7 +78,7 @@ These functions differ from the `vsprintf_s` and `vswprintf_s` only in that they
The versions of these functions with the `_l` suffix are identical except that they use the locale parameter passed in instead of the current thread locale.
-If the *`buffer`* or *`format`* parameters are `NULL` pointers, if count is zero, or if the format string contains invalid formatting characters, the invalid parameter handler is invoked, as described in [Parameter validation](../parameter-validation.md). If execution is allowed to continue, the functions return -1 and set `errno` to `EINVAL`.
+If the *`buffer`* or *`format`* parameters are `NULL` pointers, or if the format string contains invalid formatting characters, the invalid parameter handler is invoked, as described in [Parameter validation](../parameter-validation.md). If execution is allowed to continue, the functions return -1 and set `errno` to `EINVAL`.
> [!IMPORTANT]
> Starting in Windows 10 version 2004 (build 19041), the `printf` family of functions prints exactly representable floating point numbers according to the IEEE 754 rules for rounding. In previous versions of Windows, exactly representable floating point numbers ending in '5' would always round up. IEEE 754 states that they must round to the closest even digit (also known as "Banker's Rounding"). For example, both `printf("%1.0f", 1.5)` and `printf("%1.0f", 2.5)` should round to 2. Previously, 1.5 would round to 2 and 2.5 would round to 3. This change only affects exactly representable numbers. For example, 2.35 (which, when represented in memory, is closer to 2.35000000000000008) continues to round up to 2.4. Rounding done by these functions now also respects the floating point rounding mode set by [`fesetround`](fegetround-fesetround2.md). Previously, rounding always chose `FE_TONEAREST` behavior. This change only affects programs built using Visual Studio 2019 version 16.2 and later. To use the legacy floating point rounding behavior, link with ['legacy_stdio_float_rounding.obj`](../link-options.md).
diff --git a/docs/c-runtime-library/reference/vsprintf-s-vsprintf-s-l-vswprintf-s-vswprintf-s-l.md b/docs/c-runtime-library/reference/vsprintf-s-vsprintf-s-l-vswprintf-s-vswprintf-s-l.md
index c29347d3ea..991b132063 100644
--- a/docs/c-runtime-library/reference/vsprintf-s-vsprintf-s-l-vswprintf-s-vswprintf-s-l.md
+++ b/docs/c-runtime-library/reference/vsprintf-s-vsprintf-s-l-vswprintf-s-vswprintf-s-l.md
@@ -1,19 +1,19 @@
---
description: "Learn more about: vsprintf_s, _vsprintf_s_l, vswprintf_s, _vswprintf_s_l"
-title: "vsprintf_s, _vsprintf_s_l, vswprintf_s, _vswprintf_s_l"
+title: "vsprintf_s, _vsprintf_s_l, vswprintf_s, _vswprintf_s_l, _vstprintf_s, _vstprintf_s_l"
ms.date: "3/9/2021"
-api_name: ["_vswprintf_s_l", "vsprintf_s", "vswprintf_s", "_vsprintf_s_l"]
+api_name: ["_vswprintf_s_l", "vsprintf_s", "vswprintf_s", "_vsprintf_s_l", _vstprintf_s, _vstprintf_s_l]
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", "ntoskrnl.exe"]
api_type: ["DLLExport"]
topic_type: ["apiref"]
-f1_keywords: ["CORECRT_WSTDIO/vswprintf_s", "STDIO/vsprintf_s", "TCHAR/_vstprintf_s", "vswprintf_s", "vsprintf_s", "_vstprintf_s", "_vswprintf_s_l"]
+f1_keywords: ["CORECRT_WSTDIO/vswprintf_s", "STDIO/vsprintf_s", "TCHAR/_vstprintf_s", "vswprintf_s", "vsprintf_s", "_vstprintf_s", "_vstprintf_s_l", "_vswprintf_s_l"]
helpviewer_keywords: ["_vstprintf_s_l function", "vsprintf_s_l function", "_vstprintf_s function", "vswprintf_s function", "vstprintf_s function", "vstprintf_s_l function", "vswprintf_s_l function", "vsprintf_s function", "_vsprintf_s_l function", "formatted text [C++]", "_vswprintf_s_l function"]
---
-# `vsprintf_s`, `_vsprintf_s_l`, `vswprintf_s`, `_vswprintf_s_l`
+# `vsprintf_s`, `_vsprintf_s_l`, `vswprintf_s`, `_vswprintf_s_l`, `_vstprintf_s`, `_vstprintf_s_l`
Write formatted output using a pointer to a list of arguments. These functions are versions of [`vsprintf`, `_vsprintf_l`, `vswprintf`, `_vswprintf_l`, \`__vswprintf_l`](vsprintf-vsprintf-l-vswprintf-vswprintf-l-vswprintf-l.md) with security enhancements as described in [Security features in the CRT](../security-features-in-the-crt.md).
-For `_vstprintf_s` and `_vstprintf_s_l`, see [Generic-text routine mappings](#generic-text-routine-mappings).
+For `_vstprintf_s` and `_vstprintf_s_l`, see [Generic-text function mappings](#generic-text-function-mappings).
## Syntax
@@ -96,7 +96,7 @@ In C++, using these functions is simplified by template overloads. The overloads
> [!IMPORTANT]
> Starting in Windows 10 version 2004 (build 19041), the `printf` family of functions prints exactly representable floating point numbers according to the IEEE 754 rules for rounding. In previous versions of Windows, exactly representable floating point numbers ending in '5' would always round up. IEEE 754 states that they must round to the closest even digit (also known as "Banker's Rounding"). For example, both `printf("%1.0f", 1.5)` and `printf("%1.0f", 2.5)` should round to 2. Previously, 1.5 would round to 2 and 2.5 would round to 3. This change only affects exactly representable numbers. For example, 2.35 (which, when represented in memory, is closer to 2.35000000000000008) continues to round up to 2.4. Rounding done by these functions now also respects the floating point rounding mode set by [`fesetround`](fegetround-fesetround2.md). Previously, rounding always chose `FE_TONEAREST` behavior. This change only affects programs built using Visual Studio 2019 version 16.2 and later. To use the legacy floating point rounding behavior, link with ['legacy_stdio_float_rounding.obj`](../link-options.md).
-### Generic-text routine mappings
+### Generic-text function mappings
The function in the `tchar.h` column maps to the function in the other columns depending on the character set that is defined at compile time.
diff --git a/docs/c-runtime-library/reference/vsprintf-vsprintf-l-vswprintf-vswprintf-l-vswprintf-l.md b/docs/c-runtime-library/reference/vsprintf-vsprintf-l-vswprintf-vswprintf-l-vswprintf-l.md
index 0d197f9619..b3296103ad 100644
--- a/docs/c-runtime-library/reference/vsprintf-vsprintf-l-vswprintf-vswprintf-l-vswprintf-l.md
+++ b/docs/c-runtime-library/reference/vsprintf-vsprintf-l-vswprintf-vswprintf-l-vswprintf-l.md
@@ -95,6 +95,10 @@ The locale to use.
**`vsprintf`** and **`vswprintf`** return the number of characters written, not including the terminating `NULL` character, or a negative value if an output error occurs. If *`buffer`* or *`format`* is a `NULL` pointer, these functions invoke the invalid parameter handler, as described in [Parameter validation](../parameter-validation.md). If execution is allowed to continue, these functions return -1 and set `errno` to `EINVAL`.
+If *`buffer`* is a `NULL` pointer and *`count`* is zero, **`vswprintf`** and **`_vswprintf_l`** return the number of characters that would have been written not including the terminating NULL.
+
+If *`buffer`* is valid and *`count`* is zero, **`vswprintf`** and **`_vswprintf_l`** return -1. The contents of *`buffer`* are unchanged.
+
For information on these and other error codes, see [`errno`, `_doserrno`, `_sys_errlist`, and `_sys_nerr`](../errno-doserrno-sys-errlist-and-sys-nerr.md).
## Remarks
diff --git a/docs/c-runtime-library/routine-mappings.md b/docs/c-runtime-library/routine-mappings.md
index 64d52861ae..087515c0cd 100644
--- a/docs/c-runtime-library/routine-mappings.md
+++ b/docs/c-runtime-library/routine-mappings.md
@@ -1,19 +1,21 @@
---
-description: "Learn more about: Routine Mappings"
-title: "Routine Mappings"
+description: "Learn more about: Microsoft specific generic-text functions and the CRT functions they map to."
+title: "Generic-text function mappings"
ms.date: "11/04/2016"
-helpviewer_keywords: ["_tWinMain", "TCHAR.H data types, list of routine mappings", "generic-text mappings"]
-ms.assetid: 38f33d3b-0f7b-430d-8a4f-75e27c6f1c42
+ms.author: twhitney
+api_name: ["foo",]
+f1_keywords: ["_cgetts", "_cgetts_s", "_cputts", "_fgettc", "_fgettchar", "_fgetts", "_fputtc", "_fputtchar", "_fputts", "_ftscanf", "_ftscanf_s", "_gettc", "_gettch", "_gettchar", "_gettche", "_getts", "_getts_s", "_istalnum", "_istalpha", "_istascii", "_istcntrl", "_istdigit", "_istgraph", "_istlead", "_istleadbyte", "_istlegal", "_istlower", "_istprint", "_istpunct", "_istspace", "_istupper", "_istxdigit", "_itot", "_itot_s", "_ltot", "_ltot_s", "_puttc", "_puttch", "_puttchar", "_putts", "_sctprintf", "_sntprintf", "_sntprintf_s", "_sntscanf", "_sntscanf_s", "_stprintf", "_stprintf_s", "_stscanf", "_stscanf_s", "_taccess", "_tasctime", "_tasctime_s", "_tccmp", "_tccpy", "_tccpy_s", "_tchdir", "_tclen", "_tchmod", "_tcprintf", "_tcprintf_s", "_tcreat", "_tcscanf", "_tcscanf_s", "_tcscat", "_tcscat_s", "_tcschr", "_tcsclen", "_tcsclen_s", "_tcscmp", "_tcscoll", "_tcscpy", "_tcscpy_s", "_tcscspn", "_tcsdec", "_tcsdup", "_tcserror", "_tcserror_s", "_tcsftime", "_tcsicmp", "_tcsicoll", "_tcsinc", "_tcslen", "_tcslwr", "_tcslwr_s", "_tcsnbcnt", "_tcsncat", "_tcsncat_s", "_tcsnccat", "_tcsnccmp", "_tcsnccmp_s", "_tcsnccoll", "_tcsncmp", "_tcsnccnt", "_tcsnccpy", "_tcsncicmp", "_tcsncicoll", "_tcsncpy", "_tcsncset", "_tcsnextc", "_tcsnicmp", "_tcsnicoll", "_tcsninc", "_tcsnccnt", "_tcsnset", "_tcspbrk", "_tcsspnp", "_tcsrchr", "_tcsrev", "_tcsset", "_tcsspn", "_tcsstr", "_tcstod", "_tcstoi64", "_tcstok", "_tcstok_s", "_tcstol", "_tcstoui64", "_tcstoul", "_tcsupr", "_tcsupr_s", "_tcsxfrm", "_tctime", "_tctime_s", "_tctime32", "_tctime32_s", "_tctime64", "_tctime64_s", "_texecl", "_texecle", "_texeclp", "_texeclpe", "_texecv", "_texecve", "_texecvp", "_texecvpe", "_tfdopen", "_tfindfirst", "_tfindnext", "_tfindnext32", "_tfindnext64", "_tfindnexti64", "_tfindnexti6432", "_tfindnext32i64", "_tfopen", "_tfopen_s", "_tfreopen", "_tfreopen_s", "_tfsopen", "_tfullpath", "_tgetcwd", "_tgetdcwd", "_tgetenv", "_tgetenv_s", "_tmain", "_tmakepath", "_tmakepath_s", "_tmkdir", "_tmktemp", "_tmktemp_s", "_topen", "_topen_s", "_totlower", "_totupper", "_tperror", "_tpopen", "_tprintf", "_tprintf_s", "_tputenv", "_tremove", "_trename", "_trmdir", "_tsearchenv", "_tsearchenv_s", "_tscanf", "_tscanf_s", "_tsetlocale", "_tsopen", "_tsopen_s", "_tspawnl", "_tspawnle", "_tspawnlp", "_tspawnlpe", "_tspawnv", "_tspawnve", "_tspawnvp", "_tspawnvpe", "_tsplitpath", "_tstat", "_tstat32", "_tstati32", "_tstat64", "_tstati64", "_tstof", "_tstoi", "_tstoi64", "_tstol", "_tstrdate", "_tstrdate_s", "_tstrtime", "_tstrtime_s", "_tsystem", "_ttempnam", "_ttmpnam", "_ttmpnam_s", "_ttoi", "_ttoi64", "_ttol", "_tunlink", "_tutime", "_tutime32", "_tutime64", "_tWinMain", "_ui64tot", "_ui64tot_s", "_ultot", "_ultot_s", "_ungettc", "_ungettch", "_vftprintf", "_vftprintf_s", "_vsctprintf", "_vsctprintf_s", "_vsntprintf", "_vsntprintf_s", "_vstprintf", "_vtprintf", "_vtprintf_s"]
+helpviewer_keywords: ["_tWinMain", "TCHAR.H functions, list of generic-text function mappings", "generic-text mappings", "_cgetts function", "_cgetts_s function", "_cputts function", "_fgettc function", "_fgettchar function", "_fgetts function", "_fputtc function", "_fputtchar function", "_fputts function", "_ftscanf function", "_ftscanf_s function", "_gettc function", "_gettch function", "_gettchar function", "_gettche function", "_getts function", "_getts_s function", "_istalnum function", "_istalpha function", "_istascii function", "_istcntrl function", "_istdigit function", "_istgraph function", "_istlead function", "_istleadbyte function", "_istlegal function", "_istlower function", "_istprint function", "_istpunct function", "_istspace function", "_istupper function", "_istxdigit function", "_itot function", "_itot_s function", "_ltot function", "_ltot_s function", "_puttc function", "_puttch function", "_puttchar function", "_putts function", "_sctprintf function", "_sntprintf function", "_sntprintf_s function", "_sntscanf function", "_sntscanf_s function", "_stprintf function", "_stprintf_s function", "_stscanf function", "_stscanf_s function", "_taccess function", "_tasctime function", "_tasctime_s function", "_tccmp function", "_tccpy function", "_tccpy_s function", "_tchdir function", "_tclen function", "_tchmod function", "_tcprintf function", "_tcprintf_s function", "_tcreat function", "_tcscanf function", "_tcscanf_s function", "_tcscat function", "_tcscat_s function", "_tcschr function", "_tcsclen function", "_tcsclen_s function", "_tcscmp function", "_tcscoll function", "_tcscpy function", "_tcscpy_s function", "_tcscspn function", "_tcsdec function", "_tcsdup function", "_tcserror function", "_tcserror_s function", "_tcsftime function", "_tcsicmp function", "_tcsicoll function", "_tcsinc function", "_tcslen function", "_tcslwr function", "_tcslwr_s function", "_tcsnbcnt function", "_tcsncat function", "_tcsncat_s function", "_tcsnccat function", "_tcsnccmp function", "_tcsnccmp_s function", "_tcsnccoll function", "_tcsncmp function", "_tcsnccnt function", "_tcsnccpy function", "_tcsncicmp function", "_tcsncicoll function", "_tcsncpy function", "_tcsncset function", "_tcsnextc function", "_tcsnicmp function", "_tcsnicoll function", "_tcsninc function", "_tcsnccnt function", "_tcsnset function", "_tcspbrk function", "_tcsspnp function", "_tcsrchr function", "_tcsrev function", "_tcsset function", "_tcsspn function", "_tcsstr function", "_tcstod function", "_tcstoi64 function", "_tcstok function", "_tcstok_s function", "_tcstol function", "_tcstoui64 function", "_tcstoul function", "_tcsupr function", "_tcsupr_s function", "_tcsxfrm function", "_tctime function", "_tctime_s function", "_tctime32 function", "_tctime32_s function", "_tctime64 function", "_tctime64_s function", "_texecl function", "_texecle function", "_texeclp function", "_texeclpe function", "_texecv function", "_texecve function", "_texecvp function", "_texecvpe function", "_tfdopen function", "_tfindfirst function", "_tfindnext function", "_tfindnext32 function", "_tfindnext64 function", "_tfindnexti64 function", "_tfindnexti6432 function", "_tfindnext32i64 function", "_tfopen function", "_tfopen_s function", "_tfreopen function", "_tfreopen_s function", "_tfsopen function", "_tfullpath function", "_tgetcwd function", "_tgetdcwd function", "_tgetenv function", "_tgetenv_s function", "_tmain function", "_tmakepath function", "_tmakepath_s function", "_tmkdir function", "_tmktemp function", "_tmktemp_s function", "_topen function", "_topen_s function", "_totlower function", "_totupper function", "_tperror function", "_tpopen function", "_tprintf function", "_tprintf_s function", "_tputenv function", "_tremove function", "_trename function", "_trmdir function", "_tsearchenv function", "_tsearchenv_s function", "_tscanf function", "_tscanf_s function", "_tsetlocale function", "_tsopen function", "_tsopen_s function", "_tspawnl function", "_tspawnle function", "_tspawnlp function", "_tspawnlpe function", "_tspawnv function", "_tspawnve function", "_tspawnvp function", "_tspawnvpe function", "_tsplitpath function", "_tstat function", "_tstat32 function", "_tstati32 function", "_tstat64 function", "_tstati64 function", "_tstof function", "_tstoi function", "_tstoi64 function", "_tstol function", "_tstrdate function", "_tstrdate_s function", "_tstrtime function", "_tstrtime_s function", "_tsystem function", "_ttempnam function", "_ttmpnam function", "_ttmpnam_s function", "_ttoi function", "_ttoi64 function", "_ttol function", "_tunlink function", "_tutime function", "_tutime32 function", "_tutime64 function", "_tWinMain function", "_ui64tot function", "_ui64tot_s function", "_ultot function", "_ultot_s function", "_ungettc function", "_ungettch function", "_vftprintf function", "_vftprintf_s function", "_vsctprintf function", "_vsctprintf_s function", "_vsntprintf function", "_vsntprintf_s function", "_vstprintf function", "_vtprintf function", "_vtprintf_s function"]
---
-# Routine mappings
+# Generic-text function mappings
-The generic-text routine mappings are defined in TCHAR.H. `_tccpy` and `_tclen` map to functions in the MBCS model; they're mapped to macros or inline functions in the SBCS and Unicode models for completeness. For information on a generic text routine, see the help article about the corresponding `SBCS`-, `_MBCS`-, or `_UNICODE`-related routine.
+The generic-text routine mappings are defined in `TCHAR.H`. `_tccpy` and `_tclen` map to functions in the MBCS model; they're mapped to macros or inline functions in the SBCS and Unicode models for completeness. For information on a generic text routine, see the help article about the corresponding `SBCS`-, `_MBCS`-, or `_UNICODE`-related routine.
More specific information about individual routines listed in the left column in the following table isn't available in this documentation. However, you can easily look up the information on a corresponding `SBCS`-, `_MBCS`-, or `_UNICODE`-related routine. Use the **Search** command on the **Help** menu to look up any generic-text routine listed below.
For related information, see [Generic-text mappings in tchar.h](../text/generic-text-mappings-in-tchar-h.md).
-### Generic-text routine mappings
+### Function mappings
| Generic-text routine name | `SBCS` (`_UNICODE` and `MBCS` not defined) | `_MBCS` defined | `_UNICODE` defined |
|---|---|---|---|
@@ -27,6 +29,7 @@ For related information, see [Generic-text mappings in tchar.h](../text/generic-
| `_fputtchar` | `_fputchar` | `_fputchar` | `_fputwchar` |
| `_fputts` | `fputs` | `fputs` | `fputws` |
| `_ftprintf` | `fprintf` | `fprintf` | `fwprintf` |
+| `_ftprintf_l` | `_fprintf_l` | `_fprintf_l` | `_fwprintf_l` |
| `_ftprintf_s` | `fprintf_s` | `fprintf_s` | `fwprintf_s` |
| `_ftscanf` | `fscanf` | `fscanf` | `fwscanf` |
| `_ftscanf_s` | `fscanf_s` | `fscanf_s` | `fwscanf_s` |
diff --git a/docs/c-runtime-library/security-features-in-the-crt.md b/docs/c-runtime-library/security-features-in-the-crt.md
index d1dc77a81a..06117a37fd 100644
--- a/docs/c-runtime-library/security-features-in-the-crt.md
+++ b/docs/c-runtime-library/security-features-in-the-crt.md
@@ -5,7 +5,6 @@ ms.date: "09/29/2020"
ms.topic: "conceptual"
f1_keywords: ["_CRT_SECURE_NO_DEPRECATE", "_CRT_NONSTDC_NO_DEPRECATE", "_CRT_NONSTDC_NO_WARNINGS", "_CRT_SECURE_NO_WARNINGS"]
helpviewer_keywords: ["security deprecation warnings [C++]", "CRT_NONSTDC_NO_DEPRECATE", "buffers [C++], buffer overruns", "deprecation warnings (security-related), disabling", "_CRT_NONSTDC_NO_WARNINGS", "security [CRT]", "_CRT_SECURE_NO_WARNINGS", "_CRT_NONSTDC_NO_DEPRECATE", "_CRT_SECURE_NO_DEPRECATE", "security-enhanced CRT", "CRT_SECURE_NO_WARNINGS", "CRT_SECURE_NO_DEPRECATE", "deprecation warnings (security-related)", "buffer overruns", "CRT_NONSTDC_NO_WARNINGS", "CRT, security enhancements", "parameters [C++], validation"]
-ms.assetid: d9568b08-9514-49cd-b3dc-2454ded195a3
---
# Security Features in the CRT
@@ -19,7 +18,7 @@ For example, the `strcpy` function can't tell if the string it copies is too lar
## Eliminating deprecation warnings
-There are several ways to eliminate deprecation warnings for the older, less secure functions. The simplest is simply to define `_CRT_SECURE_NO_WARNINGS` or use the [`warning`](../preprocessor/warning.md) pragma. Either will disable deprecation warnings, but the security issues that caused the warnings still exist. It's better to leave deprecation warnings enabled and take advantage of the new CRT security features.
+There are several ways to eliminate deprecation warnings for the older, less secure functions. The simplest is simply to define `_CRT_SECURE_NO_WARNINGS` or use the [`warning`](../preprocessor/warning.md) pragma. Either disables deprecation warnings, but the security issues that caused the warnings still exist. It's better to leave deprecation warnings enabled and take advantage of the new CRT security features.
In C++, the easiest way to eliminate the deprecation warnings is to use [Secure template overloads](./secure-template-overloads.md). The overloads eliminate deprecation warnings in many cases. They replace calls to deprecated functions with calls to secure versions of the functions. For example, consider this deprecated call to `strcpy`:
@@ -54,13 +53,15 @@ Some of the security features include:
You must pass the buffer size to any secure function that writes to a buffer. The secure versions validate that the buffer is large enough before writing to it. The validation helps avoid dangerous buffer overrun errors that could allow malicious code to execute. These functions usually return an `errno` error code and invoke the invalid parameter handler if the size of the buffer is too small. Functions that read from input buffers, such as `gets`, have secure versions that require you to specify a maximum size.
+ The debug versions of *some* security-enhanced CRT functions fill the buffer passed to them with a special character (0xFE). This fill character helps to find cases where the incorrect size was passed to the function. Unfortunately, it also reduces performance. To improve performance, use **`_CrtSetDebugFillThreshold`** to disable buffer-filling. For more information, and a list of functions that have this behavior, see [`_CrtSetDebugFillThreshold`](./reference/crtsetdebugfillthreshold.md).
+
- **Null termination**
- Some functions that left potentially non-terminated strings have secure versions, which ensure that strings are properly null-terminated.
+ Some functions that left potentially nonterminated strings have secure versions, which ensure that strings are properly null-terminated.
- **Enhanced error reporting**
- The secure functions return error codes with more error information than was available with the pre-existing functions. The secure functions and many of the pre-existing functions now set `errno` and often return an `errno` code type as well, to provide better error reporting.
+ The secure functions return error codes with more error information than was available with the preexisting functions. The secure functions and many of the preexisting functions now set `errno` and often return an `errno` code type as well, to provide better error reporting.
- **Filesystem security**
diff --git a/docs/c-runtime-library/stream-i-o.md b/docs/c-runtime-library/stream-i-o.md
index 180ecf2b1f..e91fcfdda2 100644
--- a/docs/c-runtime-library/stream-i-o.md
+++ b/docs/c-runtime-library/stream-i-o.md
@@ -1,9 +1,8 @@
---
-description: "Learn more about: Stream I/O"
title: "Stream I/O"
-ms.date: "11/04/2016"
+description: "Learn more about: Stream I/O"
+ms.date: 11/04/2016
helpviewer_keywords: ["I/O routines, stream I/O", "I/O [CRT], stream", "stream I/O"]
-ms.assetid: dc7874d3-a91b-456a-9015-4748bb358217
---
# Stream I/O
@@ -13,61 +12,61 @@ These functions process data in different sizes and formats, from single charact
| Routine | Use |
|---|---|
-| [`clearerr`](./reference/clearerr.md), [`clearerr_s`](./reference/clearerr-s.md) | Clear error indicator for stream |
-| [`fclose`](./reference/fclose-fcloseall.md) | Close stream |
-| [`_fcloseall`](./reference/fclose-fcloseall.md) | Close all open streams except **`stdin`**, **`stdout`**, and **`stderr`** |
-| [`_fdopen`, `wfdopen`](./reference/fdopen-wfdopen.md) | Associate stream with file descriptor of open file |
-| [`feof`](./reference/feof.md) | Test for end of file on stream |
-| [`ferror`](./reference/ferror.md) | Test for error on stream |
-| [`fflush`](./reference/fflush.md) | Flush stream to buffer or storage device |
-| [`fgetc`, `fgetwc`](./reference/fgetc-fgetwc.md) | Read character from stream (function versions of **`getc`** and **`getwc`**) |
-| [`_fgetchar`, `_fgetwchar`](./reference/fgetc-fgetwc.md) | Read character from **`stdin`** (function versions of **`getchar`** and **`getwchar`**) |
-| [`fgetpos`](./reference/fgetpos.md) | Get position indicator of stream |
-| [`fgets`, `fgetws`](./reference/fgets-fgetws.md) | Read string from stream |
-| [`_fileno`](./reference/fileno.md) | Get file descriptor associated with stream |
-| [`_flushall`](./reference/flushall.md) | Flush all streams to buffer or storage device |
-| [`fopen`, `_wfopen`](./reference/fopen-wfopen.md), [`fopen_s`, `_wfopen_s`](./reference/fopen-s-wfopen-s.md) | Open stream |
-| [`fprintf`, `_fprintf_l`, `fwprintf`, `_fwprintf_l`](./reference/fprintf-fprintf-l-fwprintf-fwprintf-l.md), [`fprintf_s`, `_fprintf_s_l`, `fwprintf_s`, `_fwprintf_s_l`](./reference/fprintf-s-fprintf-s-l-fwprintf-s-fwprintf-s-l.md) | Write formatted data to stream |
-| [`fputc`, `fputwc`](./reference/fputc-fputwc.md) | Write a character to a stream (function versions of **`putc`** and **`putwc`**) |
-| [`_fputchar`, `_fputwchar`](./reference/fputc-fputwc.md) | Write character to **`stdout`** (function versions of **`putchar`** and **`putwchar`**) |
-| [`fputs`, `fputws`](./reference/fputs-fputws.md) | Write string to stream |
-| [`fread`](./reference/fread.md) | Read unformatted data from stream |
-| [`freopen`, `_wfreopen`](./reference/freopen-wfreopen.md), [`freopen_s`, `_wfreopen_s`](./reference/freopen-s-wfreopen-s.md) | Reassign `FILE` stream pointer to new file or device |
-| [`fscanf`, `fwscanf`](./reference/fscanf-fscanf-l-fwscanf-fwscanf-l.md), [`fscanf_s`, `_fscanf_s_l`, `fwscanf_s`, `_fwscanf_s_l`](./reference/fscanf-s-fscanf-s-l-fwscanf-s-fwscanf-s-l.md) | Read formatted data from stream |
-| [`fseek`, `_fseeki64`](./reference/fseek-fseeki64.md) | Move file position to given location |
-| [`fsetpos`](./reference/fsetpos.md) | Set position indicator of stream |
-| [`_fsopen`, `_wfsopen`](./reference/fsopen-wfsopen.md) | Open stream with file sharing |
-| [`ftell`, `_ftelli64`](./reference/ftell-ftelli64.md) | Get current file position |
-| [`fwrite`](./reference/fwrite.md) | Write unformatted data items to stream |
-| [`getc`, `getwc`](./reference/getc-getwc.md) | Read character from stream (macro versions of **`fgetc`** and **`fgetwc`**) |
-| [`getchar`, `getwchar`](./reference/getc-getwc.md) | Read character from **`stdin`** (macro versions of **`fgetchar`** and **`fgetwchar`**) |
-| [`_getmaxstdio`](./reference/getmaxstdio.md) | Returns the number of simultaneously open files permitted at the stream I/O level. |
-| [`gets_s`, `_getws_s`](./reference/gets-s-getws-s.md) | Read line from **`stdin`** |
-| [`_getw`](./reference/getw.md) | Read binary **`int`** from stream |
-| [`printf`, `_printf_l`, `wprintf`, `_wprintf_l`](./reference/printf-printf-l-wprintf-wprintf-l.md),[`printf_s`, `_printf_s_l`, `wprintf_s`, `_wprintf_s_l`](./reference/printf-s-printf-s-l-wprintf-s-wprintf-s-l.md) | Write formatted data to **`stdout`** |
-| [`putc`, `putwc`](./reference/putc-putwc.md) | Write character to a stream (macro versions of **`fputc`** and **`fputwc`**) |
-| [`putchar`, `putwchar`](./reference/putc-putwc.md) | Write character to **`stdout`** (macro versions of **`fputchar`** and **`fputwchar`**) |
-| [`puts`, `_putws`](./reference/puts-putws.md) | Write line to stream |
-| [`_putw`](./reference/putw.md) | Write binary **`int`** to stream |
-| [`rewind`](./reference/rewind.md) | Move file position to beginning of stream |
-| [`_rmtmp`](./reference/rmtmp.md) | Remove temporary files created by **`tmpfile`** |
-| [`scanf`, `_scanf_l`, `wscanf`, `_wscanf_l`](./reference/scanf-scanf-l-wscanf-wscanf-l.md),[`scanf_s`, `_scanf_s_l`, `wscanf_s`, `_wscanf_s_l`](./reference/scanf-s-scanf-s-l-wscanf-s-wscanf-s-l.md) | Read formatted data from **`stdin`** |
-| [`setbuf`](./reference/setbuf.md) | Control stream buffering |
-| [`_setmaxstdio`](./reference/setmaxstdio.md) | Set a maximum for the number of simultaneously open files at the stream I/O level. |
-| [`setvbuf`](./reference/setvbuf.md) | Control stream buffering and buffer size |
-| [`_snprintf`, `_snwprintf`](./reference/snprintf-snprintf-snprintf-l-snwprintf-snwprintf-l.md), [`_snprintf_s`, `_snprintf_s_l`, `_snwprintf_s`, `_snwprintf_s_l`](./reference/snprintf-s-snprintf-s-l-snwprintf-s-snwprintf-s-l.md) | Write formatted data of specified length to string |
-| [`_snscanf`, `_snwscanf`](./reference/snscanf-snscanf-l-snwscanf-snwscanf-l.md), [`_snscanf_s`, `_snscanf_s_l`, `_snwscanf_s`, `_snwscanf_s_l`](./reference/snscanf-s-snscanf-s-l-snwscanf-s-snwscanf-s-l.md) | Read formatted data of a specified length from the standard input stream. |
-| [`sprintf`, `swprintf`](./reference/sprintf-sprintf-l-swprintf-swprintf-l-swprintf-l.md), [`sprintf_s`, `_sprintf_s_l`, `swprintf_s`, `_swprintf_s_l`](./reference/sprintf-s-sprintf-s-l-swprintf-s-swprintf-s-l.md) | Write formatted data to string |
-| [`sscanf`, `swscanf`](./reference/sscanf-sscanf-l-swscanf-swscanf-l.md), [`sscanf_s`, _sscanf_s_l, `swscanf_s`, `_swscanf_s_l`](./reference/sscanf-s-sscanf-s-l-swscanf-s-swscanf-s-l.md) | Read formatted data from string |
-| [`_tempnam`, `_wtempnam`](./reference/tempnam-wtempnam-tmpnam-wtmpnam.md) | Generate temporary filename in given directory |
-| [`tmpfile`](./reference/tmpfile.md), [`tmpfile_s`](./reference/tmpfile-s.md) | Create temporary file |
-| [`tmpnam`, `_wtmpnam`](./reference/tempnam-wtempnam-tmpnam-wtmpnam.md), [`tmpnam_s`, `_wtmpnam_s`](./reference/tmpnam-s-wtmpnam-s.md) | Generate temporary filename |
-| [`ungetc`, `ungetwc`](./reference/ungetc-ungetwc.md) | Push character back onto stream |
-| [`_vcprintf`, `_vcwprintf`](./reference/vcprintf-vcprintf-l-vcwprintf-vcwprintf-l.md), [`_vcprintf_s`, `_vcprintf_s_l`, `_vcwprintf_s`, `_vcwprintf_s_l`](./reference/vcprintf-s-vcprintf-s-l-vcwprintf-s-vcwprintf-s-l.md) | Write formatted data to the console. |
-| [`vfprintf`, `vfwprintf`](./reference/vfprintf-vfprintf-l-vfwprintf-vfwprintf-l.md), [`vfprintf_s`, `_vfprintf_s_l`, `vfwprintf_s`, `_vfwprintf_s_l`](./reference/vfprintf-s-vfprintf-s-l-vfwprintf-s-vfwprintf-s-l.md) | Write formatted data to stream |
-| [`vprintf`, `vwprintf`](./reference/vprintf-vprintf-l-vwprintf-vwprintf-l.md), [`vprintf_s`, `_vprintf_s_l`, `vwprintf_s`, `_vwprintf_s_l`](./reference/vprintf-s-vprintf-s-l-vwprintf-s-vwprintf-s-l.md) | Write formatted data to **`stdout`** |
-| [`_vsnprintf`, `_vsnwprintf`](./reference/vsnprintf-vsnprintf-vsnprintf-l-vsnwprintf-vsnwprintf-l.md), [`vsnprintf_s`, `_vsnprintf_s`, `_vsnprintf_s_l`, `_vsnwprintf_s`, `_vsnwprintf_s_l`](./reference/vsnprintf-s-vsnprintf-s-vsnprintf-s-l-vsnwprintf-s-vsnwprintf-s-l.md) | Write formatted data of specified length to buffer |
-| [`vsprintf`, `vswprintf`](./reference/vsprintf-vsprintf-l-vswprintf-vswprintf-l-vswprintf-l.md), [`vsprintf_s`, `_vsprintf_s_l`, `vswprintf_s`, `_vswprintf_s_l`](./reference/vsprintf-s-vsprintf-s-l-vswprintf-s-vswprintf-s-l.md) | Write formatted data to buffer |
+| [`clearerr`](reference/clearerr.md), [`clearerr_s`](reference/clearerr-s.md) | Clear error indicator for stream |
+| [`fclose`](reference/fclose-fcloseall.md) | Close stream |
+| [`_fcloseall`](reference/fclose-fcloseall.md) | Close all open streams except **`stdin`**, **`stdout`**, and **`stderr`** |
+| [`_fdopen`, `wfdopen`](reference/fdopen-wfdopen.md) | Associate stream with file descriptor of open file |
+| [`feof`](reference/feof.md) | Test for end of file on stream |
+| [`ferror`](reference/ferror.md) | Test for error on stream |
+| [`fflush`](reference/fflush.md) | Flush stream to buffer or storage device |
+| [`fgetc`, `fgetwc`](reference/fgetc-fgetwc.md) | Read character from stream (function versions of **`getc`** and **`getwc`**) |
+| [`_fgetchar`, `_fgetwchar`](reference/fgetc-fgetwc.md) | Read character from **`stdin`** (function versions of **`getchar`** and **`getwchar`**) |
+| [`fgetpos`](reference/fgetpos.md) | Get position indicator of stream |
+| [`fgets`, `fgetws`](reference/fgets-fgetws.md) | Read string from stream |
+| [`_fileno`](reference/fileno.md) | Get file descriptor associated with stream |
+| [`_flushall`](reference/flushall.md) | Flush all streams to buffer or storage device |
+| [`fopen`, `_wfopen`](reference/fopen-wfopen.md), [`fopen_s`, `_wfopen_s`](reference/fopen-s-wfopen-s.md) | Open stream |
+| [`fprintf`, `_fprintf_l`, `fwprintf`, `_fwprintf_l`](reference/fprintf-fprintf-l-fwprintf-fwprintf-l.md), [`fprintf_s`, `_fprintf_s_l`, `fwprintf_s`, `_fwprintf_s_l`](reference/fprintf-s-fprintf-s-l-fwprintf-s-fwprintf-s-l.md) | Write formatted data to stream |
+| [`fputc`, `fputwc`](reference/fputc-fputwc.md) | Write a character to a stream (function versions of **`putc`** and **`putwc`**) |
+| [`_fputchar`, `_fputwchar`](reference/fputc-fputwc.md) | Write character to **`stdout`** (function versions of **`putchar`** and **`putwchar`**) |
+| [`fputs`, `fputws`](reference/fputs-fputws.md) | Write string to stream |
+| [`fread`](reference/fread.md) | Read unformatted data from stream |
+| [`freopen`, `_wfreopen`](reference/freopen-wfreopen.md), [`freopen_s`, `_wfreopen_s`](reference/freopen-s-wfreopen-s.md) | Reassign `FILE` stream pointer to new file or device |
+| [`fscanf`, `fwscanf`](reference/fscanf-fscanf-l-fwscanf-fwscanf-l.md), [`fscanf_s`, `_fscanf_s_l`, `fwscanf_s`, `_fwscanf_s_l`](reference/fscanf-s-fscanf-s-l-fwscanf-s-fwscanf-s-l.md) | Read formatted data from stream |
+| [`fseek`, `_fseeki64`](reference/fseek-fseeki64.md) | Move file position to given location |
+| [`fsetpos`](reference/fsetpos.md) | Set position indicator of stream |
+| [`_fsopen`, `_wfsopen`](reference/fsopen-wfsopen.md) | Open stream with file sharing |
+| [`ftell`, `_ftelli64`](reference/ftell-ftelli64.md) | Get current file position |
+| [`fwrite`](reference/fwrite.md) | Write unformatted data items to stream |
+| [`getc`, `getwc`](reference/getc-getwc.md) | Read character from stream (macro versions of **`fgetc`** and **`fgetwc`**) |
+| [`getchar`, `getwchar`](reference/getc-getwc.md) | Read character from **`stdin`** (macro versions of **`fgetchar`** and **`fgetwchar`**) |
+| [`_getmaxstdio`](reference/getmaxstdio.md) | Returns the number of simultaneously open files permitted at the stream I/O level. |
+| [`gets_s`, `_getws_s`](reference/gets-s-getws-s.md) | Read line from **`stdin`** |
+| [`_getw`](reference/getw.md) | Read binary **`int`** from stream |
+| [`printf`, `_printf_l`, `wprintf`, `_wprintf_l`](reference/printf-printf-l-wprintf-wprintf-l.md), [`printf_s`, `_printf_s_l`, `wprintf_s`, `_wprintf_s_l`](reference/printf-s-printf-s-l-wprintf-s-wprintf-s-l.md) | Write formatted data to **`stdout`** |
+| [`putc`, `putwc`](reference/putc-putwc.md) | Write character to a stream (macro versions of **`fputc`** and **`fputwc`**) |
+| [`putchar`, `putwchar`](reference/putc-putwc.md) | Write character to **`stdout`** (macro versions of **`fputchar`** and **`fputwchar`**) |
+| [`puts`, `_putws`](reference/puts-putws.md) | Write line to stream |
+| [`_putw`](reference/putw.md) | Write binary **`int`** to stream |
+| [`rewind`](reference/rewind.md) | Move file position to beginning of stream |
+| [`_rmtmp`](reference/rmtmp.md) | Remove temporary files created by **`tmpfile`** |
+| [`scanf`, `_scanf_l`, `wscanf`, `_wscanf_l`](reference/scanf-scanf-l-wscanf-wscanf-l.md), [`scanf_s`, `_scanf_s_l`, `wscanf_s`, `_wscanf_s_l`](reference/scanf-s-scanf-s-l-wscanf-s-wscanf-s-l.md) | Read formatted data from **`stdin`** |
+| [`setbuf`](reference/setbuf.md) | Control stream buffering |
+| [`_setmaxstdio`](reference/setmaxstdio.md) | Set a maximum for the number of simultaneously open files at the stream I/O level. |
+| [`setvbuf`](reference/setvbuf.md) | Control stream buffering and buffer size |
+| [`_snprintf`, `_snwprintf`](reference/snprintf-snprintf-snprintf-l-snwprintf-snwprintf-l.md), [`_snprintf_s`, `_snprintf_s_l`, `_snwprintf_s`, `_snwprintf_s_l`](reference/snprintf-s-snprintf-s-l-snwprintf-s-snwprintf-s-l.md) | Write formatted data of specified length to string |
+| [`_snscanf`, `_snwscanf`](reference/snscanf-snscanf-l-snwscanf-snwscanf-l.md), [`_snscanf_s`, `_snscanf_s_l`, `_snwscanf_s`, `_snwscanf_s_l`](reference/snscanf-s-snscanf-s-l-snwscanf-s-snwscanf-s-l.md) | Read formatted data of a specified length from the standard input stream. |
+| [`sprintf`, `swprintf`](reference/sprintf-sprintf-l-swprintf-swprintf-l-swprintf-l.md), [`sprintf_s`, `_sprintf_s_l`, `swprintf_s`, `_swprintf_s_l`](reference/sprintf-s-sprintf-s-l-swprintf-s-swprintf-s-l.md) | Write formatted data to string |
+| [`sscanf`, `swscanf`](reference/sscanf-sscanf-l-swscanf-swscanf-l.md), [`sscanf_s`, _sscanf_s_l, `swscanf_s`, `_swscanf_s_l`](reference/sscanf-s-sscanf-s-l-swscanf-s-swscanf-s-l.md) | Read formatted data from string |
+| [`_tempnam`, `_wtempnam`](reference/tempnam-wtempnam-tmpnam-wtmpnam.md) | Generate temporary filename in given directory |
+| [`tmpfile`](reference/tmpfile.md), [`tmpfile_s`](reference/tmpfile-s.md) | Create temporary file |
+| [`tmpnam`, `_wtmpnam`](reference/tempnam-wtempnam-tmpnam-wtmpnam.md), [`tmpnam_s`, `_wtmpnam_s`](reference/tmpnam-s-wtmpnam-s.md) | Generate temporary filename |
+| [`ungetc`, `ungetwc`](reference/ungetc-ungetwc.md) | Push character back onto stream |
+| [`_vcprintf`, `_vcwprintf`](reference/vcprintf-vcprintf-l-vcwprintf-vcwprintf-l.md), [`_vcprintf_s`, `_vcprintf_s_l`, `_vcwprintf_s`, `_vcwprintf_s_l`](reference/vcprintf-s-vcprintf-s-l-vcwprintf-s-vcwprintf-s-l.md) | Write formatted data to the console. |
+| [`vfprintf`, `vfwprintf`](reference/vfprintf-vfprintf-l-vfwprintf-vfwprintf-l.md), [`vfprintf_s`, `_vfprintf_s_l`, `vfwprintf_s`, `_vfwprintf_s_l`](reference/vfprintf-s-vfprintf-s-l-vfwprintf-s-vfwprintf-s-l.md) | Write formatted data to stream |
+| [`vprintf`, `vwprintf`](reference/vprintf-vprintf-l-vwprintf-vwprintf-l.md), [`vprintf_s`, `_vprintf_s_l`, `vwprintf_s`, `_vwprintf_s_l`](reference/vprintf-s-vprintf-s-l-vwprintf-s-vwprintf-s-l.md) | Write formatted data to **`stdout`** |
+| [`_vsnprintf`, `_vsnwprintf`](reference/vsnprintf-vsnprintf-vsnprintf-l-vsnwprintf-vsnwprintf-l.md), [`vsnprintf_s`, `_vsnprintf_s`, `_vsnprintf_s_l`, `_vsnwprintf_s`, `_vsnwprintf_s_l`](reference/vsnprintf-s-vsnprintf-s-vsnprintf-s-l-vsnwprintf-s-vsnwprintf-s-l.md) | Write formatted data of specified length to buffer |
+| [`vsprintf`, `vswprintf`](reference/vsprintf-vsprintf-l-vswprintf-vswprintf-l-vswprintf-l.md), [`vsprintf_s`, `_vsprintf_s_l`, `vswprintf_s`, `_vswprintf_s_l`](reference/vsprintf-s-vsprintf-s-l-vswprintf-s-vswprintf-s-l.md) | Write formatted data to buffer |
When a program begins execution, the startup code automatically opens several streams: standard input (pointed to by **`stdin`**), standard output (pointed to by **`stdout`**), and standard error (pointed to by **`stderr`**). These streams are directed to the console (keyboard and screen) by default. Use **`freopen`** to redirect **`stdin`**, **`stdout`**, or **`stderr`** to a disk file or a device.
@@ -76,16 +75,15 @@ Files opened using the stream routines are buffered by default. The **`stdout`**
There are two ways to commit buffer contents to disk:
- Link with the file COMMODE.OBJ to set a global commit flag. The default setting of the global flag is **`n`**, for "no-commit."
-
- Set the mode flag to **`c`** with **`fopen`** or **`_fdopen`**.
Any file specifically opened with either the **`c`** or the **`n`** flag behaves according to the flag, regardless of the state of the global commit/no-commit flag.
-If your program doesn't explicitly close a stream, the stream is automatically closed when the program terminates. However, you should close a stream when your program finishes with it, as the number of streams that can be open at one time is limited. See [`_setmaxstdio`](./reference/setmaxstdio.md) for information on this limit.
+If your program doesn't explicitly close a stream, the stream is automatically closed when the program terminates. However, you should close a stream when your program finishes with it, as the number of streams that can be open at one time is limited. See [`_setmaxstdio`](reference/setmaxstdio.md) for information on this limit.
Input can follow output directly only with an intervening call to **`fflush`** or to a file-positioning function (**`fseek`**, **`fsetpos`**, or **`rewind`**). Input can be followed by output without an intervening call to a file-positioning function, if the input operation encounters the end of the file.
## See also
-[Input and output](./input-and-output.md)\
-[Universal C runtime routines by category](./run-time-routines-by-category.md)
+[Input and output](input-and-output.md)\
+[Universal C runtime routines by category](run-time-routines-by-category.md)
diff --git a/docs/c-runtime-library/time-management.md b/docs/c-runtime-library/time-management.md
index 784c4b009a..619798b3cc 100644
--- a/docs/c-runtime-library/time-management.md
+++ b/docs/c-runtime-library/time-management.md
@@ -1,42 +1,42 @@
---
-description: "Learn more about: Time Management"
title: "Time Management"
-ms.date: "11/04/2016"
+description: "Learn more about: Time Management"
+ms.date: 11/04/2016
helpviewer_keywords: ["dates, run-time library members", "time, time management", "date functions", "time functions"]
---
# Time management
Use these functions to get the current time and convert, adjust, and store it as necessary. The current time is the system time.
-The **`_ftime`** and **`localtime`** routines use the **`TZ`** environment variable. If **`TZ`** isn't set, the run-time library attempts to use the time-zone information specified by the operating system. If this information is unavailable, these functions use the default value of PST8PDT. For more information on **`TZ`**, see [`_tzset`](./reference/tzset.md); also see [`_daylight`, `timezone`, and `_tzname`](./daylight-dstbias-timezone-and-tzname.md).
+The **`_ftime`** and **`localtime`** routines use the **`TZ`** environment variable. If **`TZ`** isn't set, the run-time library attempts to use the time-zone information specified by the operating system. If this information is unavailable, these functions use the default value of PST8PDT. For more information on **`TZ`**, see [`_tzset`](reference/tzset.md); also see [`_daylight`, `timezone`, and `_tzname`](daylight-dstbias-timezone-and-tzname.md).
### Time routines
| Function | Use |
|---|---|
-| [`asctime`, `_wasctime`](./reference/asctime-wasctime.md), [`asctime_s`, `_wasctime_s`](./reference/asctime-s-wasctime-s.md) | Convert time from type **`struct tm`** to character string. The versions of these functions with the **`_s`** suffix are more secure. |
-| [`clock`](./reference/clock.md) | Return elapsed wall-clock time for process. |
-| [`ctime`, `_ctime32`, `_ctime64`, `_wctime`, `_wctime32`, `_wctime64`](./reference/ctime-ctime32-ctime64-wctime-wctime32-wctime64.md), [`_ctime_s`, `_ctime32_s`, `_ctime64_s`, `_wctime_s`, `_wctime32_s`, `_wctime64_s`](./reference/ctime-s-ctime32-s-ctime64-s-wctime-s-wctime32-s-wctime64-s.md) | Convert time from type **`time_t`**, **`__time32_t`** or **`__time64_t`** to character string. The versions of these functions with the **`_s`** suffix are more secure. |
-| [`difftime`, `_difftime32`, `_difftime64`](./reference/difftime-difftime32-difftime64.md) | Compute difference between two times. |
-| [`_ftime`, `_ftime32`, `_ftime64`](./reference/ftime-ftime32-ftime64.md),[`_ftime_s`, `_ftime32_s`, _ftime64_s](./reference/ftime-s-ftime32-s-ftime64-s.md) | Store current system time in variable of type **`struct _timeb`** or type **`struct __timeb64`** The versions of these functions with the **`_s`** suffix are more secure. |
-| [`_futime`, `_futime32`, `_futime64`](./reference/futime-futime32-futime64.md) | Set modification time on open file |
-| [`gmtime`, `_gmtime32`, `_gmtime64`](./reference/gmtime-gmtime32-gmtime64.md), [`gmtime_s`, `_gmtime32_s`, `_gmtime64_s`](./reference/gmtime-s-gmtime32-s-gmtime64-s.md) | Convert time from type **`time_t`** to **`struct tm`** or from type **`__time64_t`** to **`struct tm`**. The versions of these functions with the **`_s`** suffix are more secure. |
-| [`localtime`, `_localtime32`, `_localtime64`](./reference/localtime-localtime32-localtime64.md), [`localtime_s`, `_localtime32_s`, `_localtime64_s`](./reference/localtime-s-localtime32-s-localtime64-s.md) | Convert time from type **`time_t`** to **`struct tm`** or from type **`__time64_t`** to **`struct tm`** with local correction. The versions of these functions with the **`_s`** suffix are more secure. |
-| [`_mkgmtime`, `_mkgmtime32`, `_mkgmtime64`](./reference/mkgmtime-mkgmtime32-mkgmtime64.md) | Convert time to calendar value in Greenwich Mean Time. |
-| [`mktime`, `_mktime32`, `_mktime64`](./reference/mktime-mktime32-mktime64.md) | Convert time to calendar value. |
-| [`_strdate`, `_wstrdate`](./reference/strdate-wstrdate.md), [`_strdate_s`, `_wstrdate_s`](./reference/strdate-s-wstrdate-s.md) | Return current system date as string. The versions of these functions with the **`_s`** suffix are more secure. |
-| [`strftime`, `wcsftime`, `_strftime_l`, `_wcsftime_l`](./reference/strftime-wcsftime-strftime-l-wcsftime-l.md) | Format date-and-time string for international use. |
-| [`_strtime`, `_wstrtime`](./reference/strtime-wstrtime.md), [`_strtime_s`, `_wstrtime_s`](./reference/strtime-s-wstrtime-s.md) | Return current system time as string. The versions of these functions with the **`_s`** suffix are more secure. |
-| [`time`, `_time32`, `_time64`](./reference/time-time32-time64.md) | Get current system time as type **`time_t`**, **`__time32_t`** or as type **`__time64_t`**. |
-| [`_tzset`](./reference/tzset.md) | Set external time variables from environment time variable **`TZ`**. |
-| [`_utime`, `_utime32`, `_utime64`, `_wutime`, `_wutime32`, `_wutime64`](./reference/utime-utime32-utime64-wutime-wutime32-wutime64.md) | Set modification time for specified file using either current time or time value stored in structure. |
+| [`asctime`, `_wasctime`](reference/asctime-wasctime.md), [`asctime_s`, `_wasctime_s`](reference/asctime-s-wasctime-s.md) | Convert time from type **`struct tm`** to character string. The versions of these functions with the **`_s`** suffix are more secure. |
+| [`clock`](reference/clock.md) | Return elapsed wall-clock time for process. |
+| [`ctime`, `_ctime32`, `_ctime64`, `_wctime`, `_wctime32`, `_wctime64`](reference/ctime-ctime32-ctime64-wctime-wctime32-wctime64.md), [`_ctime_s`, `_ctime32_s`, `_ctime64_s`, `_wctime_s`, `_wctime32_s`, `_wctime64_s`](reference/ctime-s-ctime32-s-ctime64-s-wctime-s-wctime32-s-wctime64-s.md) | Convert time from type **`time_t`**, **`__time32_t`** or **`__time64_t`** to character string. The versions of these functions with the **`_s`** suffix are more secure. |
+| [`difftime`, `_difftime32`, `_difftime64`](reference/difftime-difftime32-difftime64.md) | Compute difference between two times. |
+| [`_ftime`, `_ftime32`, `_ftime64`](reference/ftime-ftime32-ftime64.md), [`_ftime_s`, `_ftime32_s`, _ftime64_s](reference/ftime-s-ftime32-s-ftime64-s.md) | Store current system time in variable of type **`struct _timeb`** or type **`struct __timeb64`** The versions of these functions with the **`_s`** suffix are more secure. |
+| [`_futime`, `_futime32`, `_futime64`](reference/futime-futime32-futime64.md) | Set modification time on open file |
+| [`gmtime`, `_gmtime32`, `_gmtime64`](reference/gmtime-gmtime32-gmtime64.md), [`gmtime_s`, `_gmtime32_s`, `_gmtime64_s`](reference/gmtime-s-gmtime32-s-gmtime64-s.md) | Convert time from type **`time_t`** to **`struct tm`** or from type **`__time64_t`** to **`struct tm`**. The versions of these functions with the **`_s`** suffix are more secure. |
+| [`localtime`, `_localtime32`, `_localtime64`](reference/localtime-localtime32-localtime64.md), [`localtime_s`, `_localtime32_s`, `_localtime64_s`](reference/localtime-s-localtime32-s-localtime64-s.md) | Convert time from type **`time_t`** to **`struct tm`** or from type **`__time64_t`** to **`struct tm`** with local correction. The versions of these functions with the **`_s`** suffix are more secure. |
+| [`_mkgmtime`, `_mkgmtime32`, `_mkgmtime64`](reference/mkgmtime-mkgmtime32-mkgmtime64.md) | Convert time to calendar value in Greenwich Mean Time. |
+| [`mktime`, `_mktime32`, `_mktime64`](reference/mktime-mktime32-mktime64.md) | Convert time to calendar value. |
+| [`_strdate`, `_wstrdate`](reference/strdate-wstrdate.md), [`_strdate_s`, `_wstrdate_s`](reference/strdate-s-wstrdate-s.md) | Return current system date as string. The versions of these functions with the **`_s`** suffix are more secure. |
+| [`strftime`, `wcsftime`, `_strftime_l`, `_wcsftime_l`](reference/strftime-wcsftime-strftime-l-wcsftime-l.md) | Format date-and-time string for international use. |
+| [`_strtime`, `_wstrtime`](reference/strtime-wstrtime.md), [`_strtime_s`, `_wstrtime_s`](reference/strtime-s-wstrtime-s.md) | Return current system time as string. The versions of these functions with the **`_s`** suffix are more secure. |
+| [`time`, `_time32`, `_time64`](reference/time-time32-time64.md) | Get current system time as type **`time_t`**, **`__time32_t`** or as type **`__time64_t`**. |
+| [`_tzset`](reference/tzset.md) | Set external time variables from environment time variable **`TZ`**. |
+| [`_utime`, `_utime32`, `_utime64`, `_wutime`, `_wutime32`, `_wutime64`](reference/utime-utime32-utime64-wutime-wutime32-wutime64.md) | Set modification time for specified file using either current time or time value stored in structure. |
> [!NOTE]
> In all versions of Microsoft C/C++ except Microsoft C/C++ version 7.0, and in all versions of Visual C++, the time function returns the current time as the number of seconds elapsed since midnight on January 1, 1970. In Microsoft C/C++ version 7.0, **`time`** returned the current time as the number of seconds elapsed since midnight on December 31, 1899.
> [!NOTE]
-> In versions of Visual C++ and Microsoft C/C++ before Visual Studio 2005, **`time_t`** was a **`long int`** (32 bits) and hence could not be used for dates past 3:14:07 January 19, 2038, UTC. **`time_t`** is now equivalent to **`__time64_t`** by default, but defining `_USE_32BIT_TIME_T` changes **`time_t`** to **`__time32_t`** and forces many time functions to call versions that take the 32-bit **`time_t`**. For more information, see [Standard types](./standard-types.md) and comments in the documentation for the individual time functions.
+> In versions of Visual C++ and Microsoft C/C++ before Visual Studio 2005, **`time_t`** was a **`long int`** (32 bits) and hence could not be used for dates past 3:14:07 January 19, 2038, UTC. **`time_t`** is now equivalent to **`__time64_t`** by default, but defining `_USE_32BIT_TIME_T` changes **`time_t`** to **`__time32_t`** and forces many time functions to call versions that take the 32-bit **`time_t`**. For more information, see [Standard types](standard-types.md) and comments in the documentation for the individual time functions.
## See also
-[Universal C runtime routines by category](./run-time-routines-by-category.md)
+[Universal C runtime routines by category](run-time-routines-by-category.md)
diff --git a/docs/c-runtime-library/toc.yml b/docs/c-runtime-library/toc.yml
index 3b46fdbc73..4eb9c708b3 100644
--- a/docs/c-runtime-library/toc.yml
+++ b/docs/c-runtime-library/toc.yml
@@ -385,7 +385,7 @@ items:
href: ../c-runtime-library/data-type-mappings.md
- name: Constant and global variable mappings
href: ../c-runtime-library/constant-and-global-variable-mappings.md
- - name: Routine mappings
+ - name: Generic-text function mappings
href: ../c-runtime-library/routine-mappings.md
- name: Locale names, languages, and country-region strings
expanded: false
@@ -475,9 +475,9 @@ items:
href: ../c-runtime-library/reference/abs-labs-llabs-abs64.md
- name: access (CRT)
href: ../c-runtime-library/reference/access-crt.md
- - name: _access, _waccess
+ - name: _access, _waccess, taccess_s
href: ../c-runtime-library/reference/access-waccess.md
- - name: _access_s, _waccess_s, taccess_s
+ - name: _access_s, _waccess_s, _taccess_s
href: ../c-runtime-library/reference/access-s-waccess-s.md
- name: acos, acosf, acosl
href: ../c-runtime-library/reference/acos-acosf-acosl.md
@@ -945,11 +945,11 @@ items:
href: ../c-runtime-library/reference/fpieee-flt.md
- name: _fpreset
href: ../c-runtime-library/reference/fpreset.md
- - name: fprintf, _fprintf_l, fwprintf, _fwprintf_l
+ - name: fprintf, _fprintf_l, fwprintf, _fwprintf_l, _ftprintf, _ftprintf_l
href: ../c-runtime-library/reference/fprintf-fprintf-l-fwprintf-fwprintf-l.md
- - name: _fprintf_p, _fprintf_p_l, _fwprintf_p, _fwprintf_p_l
+ - name: _fprintf_p, _fprintf_p_l, _ftprintf_p, _ftprintf_p_l, _fwprintf_p, _fwprintf_p_l
href: ../c-runtime-library/reference/fprintf-p-fprintf-p-l-fwprintf-p-fwprintf-p-l.md
- - name: fprintf_s, _fprintf_s_l, fwprintf_s, _fwprintf_s_l
+ - name: fprintf_s, _fprintf_s_l, fwprintf_s, _fwprintf_s_l, _ftprintf, _ftprintf_l, _ftprintf_s, _ftprintf_s_l
href: ../c-runtime-library/reference/fprintf-s-fprintf-s-l-fwprintf-s-fwprintf-s-l.md
- name: fputc, fputwc
href: ../c-runtime-library/reference/fputc-fputwc.md
@@ -1737,7 +1737,7 @@ items:
href: ../c-runtime-library/reference/strncoll-wcsncoll-mbsncoll-strncoll-l-wcsncoll-l-mbsncoll-l.md
- name: strncpy, _strncpy_l, wcsncpy, _wcsncpy_l, _mbsncpy, _mbsncpy_l
href: ../c-runtime-library/reference/strncpy-strncpy-l-wcsncpy-wcsncpy-l-mbsncpy-mbsncpy-l.md
- - name: strncpy_s, _strncpy_s_l, wcsncpy_s, _wcsncpy_s_l, _mbsncpy_s, _mbsncpy_s_l, _tcsnccpy_s, _tcsnccpy_s_l
+ - name: strncpy_s, _strncpy_s_l, wcsncpy_s, _wcsncpy_s_l, _mbsncpy_s, _mbsncpy_s_l, _tcsncpy_s, _tcsncpy_s_l, _tcsnccpy_s, _tcsnccpy_s_l
href: ../c-runtime-library/reference/strncpy-s-strncpy-s-l-wcsncpy-s-wcsncpy-s-l-mbsncpy-s-mbsncpy-s-l.md
- name: _strnextc, _wcsnextc, _mbsnextc, _mbsnextc_l
href: ../c-runtime-library/reference/strnextc-wcsnextc-mbsnextc-mbsnextc-l.md
@@ -1755,7 +1755,7 @@ items:
href: ../c-runtime-library/reference/strnset-wcsnset.md
- name: _strnset, _strnset_l, _wcsnset, _wcsnset_l, _mbsnset, _mbsnset_l
href: ../c-runtime-library/reference/strnset-strnset-l-wcsnset-wcsnset-l-mbsnset-mbsnset-l.md
- - name: _strnset_s, _strnset_s_l, _wcsnset_s, _wcsnset_s_l, _mbsnset_s, _mbsnset_s_l, _tcsncset_s, _tcsncset_s_l
+ - name: _strnset_s, _strnset_s_l, _wcsnset_s, _wcsnset_s_l, _mbsnset_s, _mbsnset_s_l, _tcsnset_s, _tcsncset_s, _tcsncset_s_l
href: ../c-runtime-library/reference/strnset-s-strnset-s-l-wcsnset-s-wcsnset-s-l-mbsnset-s-mbsnset-s-l.md
- name: strpbrk, wcspbrk, _mbspbrk, _mbspbrk_l
href: ../c-runtime-library/reference/strpbrk-wcspbrk-mbspbrk-mbspbrk-l.md
@@ -1929,7 +1929,7 @@ items:
href: ../c-runtime-library/reference/vsprintf-vsprintf-l-vswprintf-vswprintf-l-vswprintf-l.md
- name: _vsprintf_p, _vsprintf_p_l, _vswprintf_p, _vswprintf_p_l
href: ../c-runtime-library/reference/vsprintf-p-vsprintf-p-l-vswprintf-p-vswprintf-p-l.md
- - name: vsprintf_s, _vsprintf_s_l, vswprintf_s, _vswprintf_s_l
+ - name: vsprintf_s, _vsprintf_s_l, vswprintf_s, _vswprintf_s_l, _vstprintf_s, _vstprintf_s_l
href: ../c-runtime-library/reference/vsprintf-s-vsprintf-s-l-vswprintf-s-vswprintf-s-l.md
- name: vsscanf, vswscanf
href: ../c-runtime-library/reference/vsscanf-vswscanf.md
diff --git a/docs/c-runtime-library/unicode-the-wide-character-set.md b/docs/c-runtime-library/unicode-the-wide-character-set.md
index a45fbb30f3..9fbde6648e 100644
--- a/docs/c-runtime-library/unicode-the-wide-character-set.md
+++ b/docs/c-runtime-library/unicode-the-wide-character-set.md
@@ -8,7 +8,7 @@ ms.assetid: b6a05a21-59a5-4d30-8c85-2dbe185f7a74
---
# Unicode: The wide-character set
-A wide character is a 2-byte multilingual character code. Any character in use in modern computing worldwide, including technical symbols and special publishing characters, can be represented according to the Unicode specification as a wide character. Developed and maintained by a large consortium that includes Microsoft, the Unicode standard is now widely accepted.
+A wide character is a 2-byte multilingual character code. Any character in use in modern computing worldwide, including technical symbols and special publishing characters, can be represented according to the Unicode specification as one or more wide characters. Developed and maintained by a large consortium that includes Microsoft, the Unicode standard is now widely accepted.
A wide character is of type **`wchar_t`**. A wide-character string is represented as a **`wchar_t[]`** array. You point to the array with a `wchar_t*` pointer.
diff --git a/docs/c-runtime-library/vprintf-functions.md b/docs/c-runtime-library/vprintf-functions.md
index bc1cb41d24..6119ea7428 100644
--- a/docs/c-runtime-library/vprintf-functions.md
+++ b/docs/c-runtime-library/vprintf-functions.md
@@ -1,9 +1,8 @@
---
-description: "Learn more about: vprintf Functions"
title: "vprintf Functions"
+description: "Learn more about: vprintf Functions"
ms.date: "11/04/2016"
helpviewer_keywords: ["vprintf functions", "formatted text [C++]"]
-ms.assetid: 02ac7c51-eab1-4bf0-bf4c-77065e3fa744
---
# `vprintf` functions
@@ -17,7 +16,7 @@ Each of the `vprintf` functions takes a pointer to an argument list, then format
[`_vprintf_p`, `_vprintf_p_l`, `_vwprintf_p`, `_vwprintf_p_l`](./reference/vprintf-p-vprintf-p-l-vwprintf-p-vwprintf-p-l.md)\
[`vprintf_s`, `_vprintf_s_l`, `vwprintf_s`, `_vwprintf_s_l`](./reference/vprintf-s-vprintf-s-l-vwprintf-s-vwprintf-s-l.md)\
[`_vscprintf`, `_vscprintf_l`, `_vscwprintf`, `_vscwprintf_l`](./reference/vscprintf-vscprintf-l-vscwprintf-vscwprintf-l.md)\
-[`_vsnprintf`, `_vsnwprintf`](./reference/vsnprintf-vsnprintf-vsnprintf-l-vsnwprintf-vsnwprintf-l.md)
+[`_vsnprintf`, `_vsnwprintf`](./reference/vsnprintf-vsnprintf-vsnprintf-l-vsnwprintf-vsnwprintf-l.md)\
[`vsprintf`, `vswprintf`](./reference/vsprintf-vsprintf-l-vswprintf-vswprintf-l-vswprintf-l.md)\
[`_vsprintf_p`, `_vsprintf_p_l`, `_vswprintf_p`, `_vswprintf_p_l`](./reference/vsprintf-p-vsprintf-p-l-vswprintf-p-vswprintf-p-l.md)\
[`vsprintf_s`, `_vsprintf_s_l`, `vswprintf_s`, `_vswprintf_s_l`](./reference/vsprintf-s-vsprintf-s-l-vswprintf-s-vswprintf-s-l.md)
diff --git a/docs/cloud/cloud-and-web-programming-in-visual-cpp.md b/docs/cloud/cloud-and-web-programming-in-visual-cpp.md
index 8ae34ccfbc..f2c9b0519b 100644
--- a/docs/cloud/cloud-and-web-programming-in-visual-cpp.md
+++ b/docs/cloud/cloud-and-web-programming-in-visual-cpp.md
@@ -1,8 +1,7 @@
---
-description: "Learn more about: Cloud and Web Programming in Visual C++"
title: "Cloud and Web Programming in Visual C++"
+description: "Learn more about: Cloud and Web Programming in Visual C++"
ms.date: "05/14/2019"
-ms.assetid: b63611f1-9723-44d0-ba7f-c3ebef341313
ms.topic: "overview"
ms.custom: intro-overview
---
@@ -43,7 +42,7 @@ In C++, you have several options for connecting to the web and the cloud.
- [Windows::Web::Http::HttpClient](/uwp/api/windows.web.http.httpclient)
- A Windows Runtime HTTP client class modeled on the .NET Framework class of the same name in the System.Web namespace. `HttpClient` fully supports asynchronous upload and download over HTTP, and pipeline filters that enable the insertion of custom HTTP handlers into the pipeline. The Windows SDK includes sample filters for metered networks, OAuth authentication, and more. For apps that target only Universal Windows Platform, we recommend that you use the `Windows::Web:HttpClient` class.
+ A Windows Runtime HTTP client class modeled on the .NET Framework class of the same name in the System.Web namespace. `HttpClient` fully supports asynchronous upload and download over HTTP, and pipeline filters that enable the insertion of custom HTTP handlers into the pipeline. The Windows SDK includes sample filters for metered networks, OAuth authentication, and more. For apps that target only Universal Windows Platform, we recommend that you use the `Windows::Web::Http::HttpClient` class.
- [IXMLHTTPRequest2 interface](/windows/win32/api/msxml6/nn-msxml6-ixmlhttprequest2)
@@ -55,6 +54,6 @@ In C++, you have several options for connecting to the web and the cloud.
## See also
-[C++ in Visual Studio](../overview/visual-cpp-in-visual-studio.md)
-[Microsoft Azure C and C++ Developer Center](https://azure.microsoft.com/develop/cpp/)
+[C++ in Visual Studio](../overview/visual-cpp-in-visual-studio.md)\
+[Microsoft Azure C and C++ Developer Center](https://azure.microsoft.com/develop/cpp/)\
[Networks and web services (UWP)](/windows/uwp/networking/)
diff --git a/docs/code-quality/annotating-locking-behavior.md b/docs/code-quality/annotating-locking-behavior.md
index ddf60a045a..a362074bad 100644
--- a/docs/code-quality/annotating-locking-behavior.md
+++ b/docs/code-quality/annotating-locking-behavior.md
@@ -33,9 +33,9 @@ ms.assetid: 07769c25-9b97-4ab7-b175-d1c450308d7a
To avoid concurrency bugs in your multithreaded program, always follow an appropriate locking discipline and use SAL annotations.
-Concurrency bugs are notoriously hard to reproduce, diagnose, and debug because they're non-deterministic. Reasoning about thread interleaving is difficult at best, and becomes impractical when you're designing a body of code that has more than a few threads. Therefore, it's good practice to follow a locking discipline in your multithreaded programs. For example, obeying a lock order while acquiring multiple locks helps avoid deadlocks, and acquiring the proper guarding lock before accessing a shared resource helps prevent race conditions.
+Concurrency bugs are notoriously hard to reproduce, diagnose, and debug because they're nondeterministic. Reasoning about thread interleaving is difficult at best, and becomes impractical when you're designing a body of code that has more than a few threads. Therefore, it's good practice to follow a locking discipline in your multithreaded programs. For example, obeying a lock order while acquiring multiple locks helps avoid deadlocks, and acquiring the proper guarding lock before accessing a shared resource helps prevent race conditions.
-Unfortunately, seemingly simple locking rules can be surprisingly hard to follow in practice. A fundamental limitation in today's programming languages and compilers is that they do not directly support the specification and analysis of concurrency requirements. Programmers have to rely on informal code comments to express their intentions about how they use locks.
+Unfortunately, seemingly simple locking rules can be surprisingly hard to follow in practice. A fundamental limitation in today's programming languages and compilers is that they don't directly support the specification and analysis of concurrency requirements. Programmers have to rely on informal code comments to express their intentions about how they use locks.
Concurrency SAL annotations are designed to help you specify locking side effects, locking responsibility, data guardianship, lock order hierarchy, and other expected locking behavior. By making implicit rules explicit, SAL concurrency annotations provide a consistent way for you to document how your code uses locking rules. Concurrency annotations also enhance the ability of code analysis tools to find race conditions, deadlocks, mismatched synchronization operations, and other subtle concurrency errors.
@@ -64,10 +64,10 @@ The following table lists the locking annotations.
|`_Acquires_nonreentrant_lock_(expr)`|The lock that's named by `expr` is acquired. An error is reported if the lock is already held.|
|`_Acquires_shared_lock_(expr)`|Annotates a function and indicates that in post state the function increments by one the shared lock count of the lock object that's named by `expr`.|
|`_Create_lock_level_(name)`|A statement that declares the symbol `name` to be a lock level so that it may be used in the annotations `_Has_Lock_level_` and `_Lock_level_order_`.|
-|`_Has_lock_kind_(kind)`|Annotates any object to refine the type information of a resource object. Sometimes a common type is used for different kinds of resources and the overloaded type isn't sufficient to distinguish the semantic requirements among various resources. Here's a list of pre-defined `kind` parameters:
`_Lock_kind_mutex_`
Lock kind ID for mutexes.
`_Lock_kind_event_`
Lock kind ID for events.
`_Lock_kind_semaphore_`
Lock kind ID for semaphores.
`_Lock_kind_spin_lock_`
Lock kind ID for spin locks.
`_Lock_kind_critical_section_`
Lock kind ID for critical sections.|
+|`_Has_lock_kind_(kind)`|Annotates any object to refine the type information of a resource object. Sometimes a common type is used for different kinds of resources and the overloaded type isn't sufficient to distinguish the semantic requirements among various resources. Here's a list of predefined `kind` parameters:
`_Lock_kind_mutex_`
Lock kind ID for mutexes.
`_Lock_kind_event_`
Lock kind ID for events.
`_Lock_kind_semaphore_`
Lock kind ID for semaphores.
`_Lock_kind_spin_lock_`
Lock kind ID for spin locks.
`_Lock_kind_critical_section_`
Lock kind ID for critical sections.|
|`_Has_lock_level_(name)`|Annotates a lock object and gives it the lock level of `name`.|
|`_Lock_level_order_(name1, name2)`|A statement that gives the lock ordering between `name1` and `name2`. Locks that have level `name1` must be acquired before locks that have level `name2`.|
-|`_Post_same_lock_(expr1, expr2)`|Annotates a function and indicates that in post state the two locks, `expr1` and `expr2`, are treated as if they're the same lock object.|
+|`_Post_same_lock_(dst, src)`|Annotates a function and indicates that in post state the two locks, `dst` and `src`, are treated as if they're the same lock object, by applying lock properties from `src` to `dst`.|
|`_Releases_exclusive_lock_(expr)`|Annotates a function and indicates that in post state the function decrements by one the exclusive lock count of the lock object that's named by `expr`.|
|`_Releases_lock_(expr)`|Annotates a function and indicates that in post state the function decrements by one the lock count of the lock object that's named by `expr`.|
|`_Releases_nonreentrant_lock_(expr)`|The lock that's named by `expr` is released. An error is reported if the lock isn't currently held.|
@@ -97,17 +97,17 @@ The following table lists the annotations for shared data access.
|----------------|-----------------|
|`_Guarded_by_(expr)`|Annotates a variable and indicates that whenever the variable is accessed, the lock count of the lock object that's named by `expr` is at least one.|
|`_Interlocked_`|Annotates a variable and is equivalent to `_Guarded_by_(_Global_interlock_)`.|
-|`_Interlocked_operand_`|The annotated function parameter is the target operand of one of the various Interlocked functions. Those operands must have specific additional properties.|
+|`_Interlocked_operand_`|The annotated function parameter is the target operand of one of the various Interlocked functions. Those operands must have other specific properties.|
|`_Write_guarded_by_(expr)`|Annotates a variable and indicates that whenever the variable is modified, the lock count of the lock object that's named by `expr` is at least one.|
## Smart Lock and RAII Annotations
-Smart locks typically wrap native locks and manage their lifetime. The following table lists annotations that can be used with smart locks and RAII coding patterns with support for `move` semantics.
+Smart locks typically wrap native locks and manage their lifetime. The following table lists annotations that can be used with smart locks and Resource Acquisition Is Initialization (RAII) coding patterns with support for `move` semantics.
|Annotation|Description|
|----------------|-----------------|
-|`_Analysis_assume_smart_lock_acquired_(lock)`|Tells the analyzer to assume that a smart lock has been acquired. This annotation expects a reference lock type as its parameter.|
-|`_Analysis_assume_smart_lock_released_(lock)`|Tells the analyzer to assume that a smart lock has been released. This annotation expects a reference lock type as its parameter.|
+|`_Analysis_assume_smart_lock_acquired_(lock)`|Tells the analyzer to assume that a smart lock was acquired. This annotation expects a reference lock type as its parameter.|
+|`_Analysis_assume_smart_lock_released_(lock)`|Tells the analyzer to assume that a smart lock was released. This annotation expects a reference lock type as its parameter.|
|`_Moves_lock_(target, source)`|Describes a `move constructor` operation, which transfers lock state from the `source` object to the `target`. The `target` is considered a newly constructed object, so any state it had before is lost and replaced by the `source` state. The `source` is also reset to a clean state with no lock counts or aliasing target, but aliases pointing to it remain unchanged.|
|`_Replaces_lock_(target, source)`|Describes `move assignment operator` semantics where the target lock is released before transferring the state from the source. You can regard it as a combination of `_Moves_lock_(target, source)` preceded by a `_Releases_lock_(target)`.|
|`_Swaps_locks_(left, right)`|Describes the standard `swap` behavior, which assumes that objects `left` and `right` exchange their state. The state exchanged includes lock count and aliasing target, if present. Aliases that point to the `left` and `right` objects remain unchanged.|
diff --git a/docs/code-quality/annotating-structs-and-classes.md b/docs/code-quality/annotating-structs-and-classes.md
index 32669912be..1c19f33cdd 100644
--- a/docs/code-quality/annotating-structs-and-classes.md
+++ b/docs/code-quality/annotating-structs-and-classes.md
@@ -1,6 +1,6 @@
---
-description: "Learn more about: Annotating Structs and Classes"
title: Annotating Structs and Classes
+description: "Learn more about: Annotating Structs and Classes"
ms.date: 06/28/2019
ms.topic: "conceptual"
f1_keywords:
@@ -19,7 +19,6 @@ f1_keywords:
- "_Field_size_full_"
- "_Field_size_full_opt_"
- "_Field_z_"
-ms.assetid: b8278a4a-c86e-4845-aa2a-70da21a1dd52
---
# Annotating Structs and Classes
@@ -52,13 +51,11 @@ You can annotate struct and class members by using annotations that act like inv
Applies to struct or class declaration. Indicates that a valid object of that type may be larger than the declared type, with the number of bytes being specified by `size`. For example:
```cpp
-
typedef _Struct_size_bytes_(nSize)
struct MyStruct {
size_t nSize;
...
};
-
```
The buffer size in bytes of a parameter `pM` of type `MyStruct *` is then taken to be:
diff --git a/docs/code-quality/build-reliable-secure-programs.md b/docs/code-quality/build-reliable-secure-programs.md
index 39cdc8e125..83f1605db1 100644
--- a/docs/code-quality/build-reliable-secure-programs.md
+++ b/docs/code-quality/build-reliable-secure-programs.md
@@ -1,7 +1,7 @@
---
-description: "Learn more about: Building reliable and secure C++ programs by applying NISTIR 8397 guidelines."
title: Build reliable and secure C++ programs
-ms.date: 09/28/2023
+description: "Learn more about: Building reliable and secure C++ programs by applying NISTIR 8397 guidelines."
+ms.date: 04/25/2025
ms.topic: "conceptual"
---
@@ -182,7 +182,7 @@ Remove the now-invalidated secrets from your source code, and replace them with
**Azure DevOps (AzDO)**
-AzDO users can scan their code through GitHub Advanced Security for Azure DevOps (GHAzDO). GHAzDO also allows users to prevent secret exposures by enabling Push Protection on their repositories, catching potential exposures before they're ever leaked. For more information on how to detect hardcoded secrets in code in Azure DevOps, see *Secret Scanning for Github Advanced Security for Azure DevOps* in each of the following links:
+AzDO users can scan their code through GitHub Advanced Security for Azure DevOps (GHAzDO). GHAzDO also allows users to prevent secret exposures by enabling Push Protection on their repositories, catching potential exposures before they're ever leaked. For more information on how to detect hardcoded secrets in code in Azure DevOps, see *Secret Scanning for GitHub Advanced Security for Azure DevOps* in each of the following links:
- [GitHub advanced security for Azure DevOps](https://azure.microsoft.com/products/devops/github-advanced-security)
- [Secret Scanning for GitHub Advanced Security for Azure DevOps](/azure/devops/repos/security/github-advanced-security-secret-scanning)
@@ -205,11 +205,11 @@ GitHub provides known patterns of secrets for partners and users that can be con
**Additional resources**
-- [Credential Scanning | Microsoft Code With Engineering Playbook](https://microsoft.github.io/code-with-engineering-playbook/continuous-integration/dev-sec-ops/secret-management/credential_scanning/).
-- [detect-secrets: Credential scanning tool | GitHub](https://microsoft.github.io/code-with-engineering-playbook/continuous-integration/dev-sec-ops/secret-management/recipes/detect-secrets/) - an aptly named module for detecting secrets within a code base.
-- [Running detect-secrets in Azure Pipelines](https://microsoft.github.io/code-with-engineering-playbook/continuous-integration/dev-sec-ops/secret-management/recipes/detect-secrets-ado/).
+- [Credential Scanning | Microsoft Code With Engineering Playbook](https://microsoft.github.io/code-with-engineering-playbook/CI-CD/dev-sec-ops/secrets-management/credential_scanning/).
+- [detect-secrets: Credential scanning tool | GitHub](https://microsoft.github.io/code-with-engineering-playbook/CI-CD/dev-sec-ops/secrets-management/recipes/detect-secrets/) - an aptly named module for detecting secrets within a code base.
+- [Running detect-secrets in Azure Pipelines](https://microsoft.github.io/code-with-engineering-playbook/CI-CD/dev-sec-ops/secrets-management/recipes/detect-secrets-ado/).
- [Git-secrets | GitHub awslabs](https://github.com/awslabs/git-secrets) - prevents you from committing passwords and other sensitive information to a git repository.
-- [Secrets Management | Microsoft Code with Engineering Playbook](https://microsoft.github.io/code-with-engineering-playbook/continuous-delivery/secrets-management/) - provides general guidelines on how secrets should be managed.
+- [Secrets Management | Microsoft Code with Engineering Playbook](https://microsoft.github.io/code-with-engineering-playbook/CI-CD/dev-sec-ops/secrets-management/) - provides general guidelines on how secrets should be managed.
## 2.5 Run with language- and OS-provided checks and protection
@@ -281,7 +281,7 @@ Compiler settings should opt into sensitive information discovery prevention. In
At the software level, confidential data might be transmitted to attackers if unexpectedly leaked. Failure to zero-initialize buffers and other buffer misuse might leak private confidential data to attackers that call trusted API. This class of problem best handled by enabling extra static analysis and using secure resource containers as described previously.
-- [`/Qspectre` - Mitigate speculative execution side-channel attacks](https://aka.ms/SpectreMitigations) - Inserts barrier instructions that help prevent the disclosure of sensitive data produced by speculative execution. These mitigations should be enabled for code that stores sensitive data in memory and operates across a trust boundary. Microsoft always recommends measuring performance impact against appropriate benchmarks when enabling Spectre-mitigations due to the possibility of introducing runtime checks in performance-critical blocks or loops. These code paths can disable mitigations via the [`spectre(nomitigation)`](../cpp/spectre.md) `declspec` modifier. Projects that enable `/Qspectre`` should also link to libraries that are also compiled with these mitigations, including the Microsoft runtime libraries.
+- [`/Qspectre` - Mitigate speculative execution side-channel attacks](https://aka.ms/SpectreMitigations) - Inserts barrier instructions that help prevent the disclosure of sensitive data produced by speculative execution. These mitigations should be enabled for code that stores sensitive data in memory and operates across a trust boundary. Microsoft always recommends measuring performance impact against appropriate benchmarks when enabling Spectre-mitigations due to the possibility of introducing runtime checks in performance-critical blocks or loops. These code paths can disable mitigations via the [`spectre(nomitigation)`](../cpp/spectre.md) `declspec` modifier. Projects that enable `/Qspectre` should also link to libraries that are also compiled with these mitigations, including the Microsoft runtime libraries.
## 2.6 Black box test cases
@@ -354,7 +354,7 @@ Historical test cases, also known as regression test cases, prevent old issues f
**Key qualities, and relation to other sections**
-Since they test for bug regressions, these tests should be quick and easy to run, so they can run alongside the [Code Based Test Cases] and contribute to the overall code coverage of the product. Along with this, using real examples from customers to inspire new test cases is a great way to improve coverage and quality of tests.
+Since they test for bug regressions, these tests should be quick and easy to run, so they can run alongside the [Code Based Test Cases](#27-code-based-test-cases) and contribute to the overall code coverage of the product. Along with this, using real examples from customers to inspire new test cases is a great way to improve coverage and quality of tests.
**Visual Studio**
@@ -395,7 +395,7 @@ When using both sanitizers such as [Address Sanitizer (ASan)](../sanitizers/asan
**Azure and GitHub CI/CD**
-Modify your build(s) to support continuous creation of executables that use LibFuzzer or AFL++. You can add extra computing resources required for fuzzing at services like OSS-Fuzz or OneFuzz.
+Modify your build(s) to support continuous creation of executables that use LibFuzzer or AFL++. You can add extra computing resources required for fuzzing at services like OSS-Fuzz.
## 2.10 Web Application Scanning
diff --git a/docs/code-quality/c26132.md b/docs/code-quality/c26132.md
new file mode 100644
index 0000000000..390903a605
--- /dev/null
+++ b/docs/code-quality/c26132.md
@@ -0,0 +1,73 @@
+---
+title: Warning C26132
+description: Documentation on static analysis warning C26132
+author: Rastaban
+ms.author: philc
+ms.service: visual-cpp
+ms.topic: article
+ms.date: 02/11/2025
+---
+# Warning C26132
+
+> Variable '*variable name*' should be protected by '*lock 1*', but '*lock 2*' is held instead. Possible annotation mismatch.
+
+The analyzer issues Warning C26132 when it detects that a lock, which is annotated to protect a value, isn't held while accessing the value. However, a related lock is held. The code may be thread-safe, so you might need to update the annotations.
+
+This diagnostic usually doesn't indicate a bug in the code, but rather a mismatch between the annotations and the actual locking behavior. If so, the diagnostic should be resolved as there may be other static analysis issues that aren't being reported due to the inconsistent annotations.
+
+## Examples
+
+In the following example, C26132 is emitted when `data` is used.
+
+ The annotation specifies that `customLock01` should protect the variable `data`, but `CustomLockAcquire` is responsible for acquiring the related lock `customLock01->cs`.
+
+```cpp
+#include
+struct CustomLock
+{
+ int cs; // "Critical Section" lock
+};
+
+_Acquires_exclusive_lock_(criticalSection->cs) // notice the `->` indirection
+void CustomLockAcquire(CustomLock* criticalSection);
+
+_Releases_lock_(criticalSection->cs) // notice the `->` indirection
+void CustomLockRelease(CustomLock* criticalSection);
+
+// global lock
+CustomLock customLock01;
+
+void Initialize(_Guarded_by_(customLock01) int* data)
+{
+ CustomLockAcquire(&customLock01);
+ *data = 1; // C26132
+ CustomLockRelease(&customLock01);
+}
+```
+
+In this example, the `Initialize` function is thread-safe and behaves as designed, but that design isn't correctly reflected in the concurrency SAL annotations. Fix by adjusting the annotations on the custom locking functions to use `criticalSection` rather than `criticalSection->cs`. The warning could also be fixed by changing the `_Guarded_by_` annotation from `customLock01` to `customLock01.cs`.
+
+```cpp
+#include
+struct CustomLock
+{
+ int cs; // "Critical Section" lock
+};
+
+_Acquires_exclusive_lock_(criticalSection)
+void CustomLockAcquire(CustomLock* criticalSection);
+
+_Releases_lock_(criticalSection)
+void CustomLockRelease(CustomLock* criticalSection);
+
+// global lock
+CustomLock customLock01;
+
+void Initialize(_Guarded_by_(customLock01) int* data)
+{
+ CustomLockAcquire(&customLock01);
+ *data = 1;
+ CustomLockRelease(&customLock01);
+}
+```
+
diff --git a/docs/code-quality/c26133.md b/docs/code-quality/c26133.md
new file mode 100644
index 0000000000..0074674044
--- /dev/null
+++ b/docs/code-quality/c26133.md
@@ -0,0 +1,76 @@
+---
+title: Warning C26133
+description: Documentation on static analysis warning C26133
+author: Rastaban
+ms.author: philc
+ms.service: visual-cpp
+ms.topic: article
+ms.date: 02/19/2025
+---
+# Warning C26133
+
+> Caller failing to hold lock '*lock 1*' before calling function '*function name*', but '*lock 2*' is held instead. Possible annotation mismatch.
+
+Warning C26133 is issued when the analyzer detects that the lock required to call a function isn't held when the function is called. However, another lock that appears to be related is held. It's possible the code is thread-safe, and the annotations need to be updated.
+
+This diagnostic usually doesn't indicate a bug in the code, but rather a mismatch between the annotations and the actual locking behavior. If so, the diagnostic should be resolved as there may be other static analysis issues that aren't being reported due to the inconsistent annotations.
+
+## Examples
+
+In the following example, C26133 is emitted when `DoTaskWithCustomLock` is called.
+
+> warning C26133: Caller failing to hold lock 'customLock01' before calling function 'DoTaskWithCustomLock', but '(&customLock01)->cs' is held instead. Possible annotation mismatch.
+
+```cpp
+#include
+
+struct CustomLock
+{
+ int cs; // "Critical Section"
+};
+
+_Acquires_exclusive_lock_(criticalSection->cs) // notice the `->` indirection
+void CustomLockAcquire(CustomLock* criticalSection);
+
+_Releases_lock_(criticalSection->cs) // notice the `->` indirection
+void CustomLockRelease(CustomLock* criticalSection);
+
+CustomLock customLock01;
+
+_Requires_lock_held_(customLock01) void DoTaskWithCustomLock();
+
+void DoTask()
+{
+ CustomLockAcquire(&customLock01);
+ DoTaskWithCustomLock(); // C26133
+ CustomLockRelease(&customLock01);
+}
+```
+
+In this example, the `DoTask` function is thread-safe and behaves as designed, but that design isn't correctly reflected in the concurrency SAL annotations. Fix by adjusting the annotations on the custom locking functions to use `criticalSection` rather than `criticalSection->cs`. The warning could also be fixed by changing the `_Requires_lock_held_` annotation from `customLock01` to `customLock01.cs`.
+
+```cpp
+#include
+
+struct CustomLock
+{
+ int cs; // "Critical Section"
+};
+
+_Acquires_exclusive_lock_(criticalSection)
+void CustomLockAcquire(CustomLock* criticalSection);
+
+_Releases_lock_(criticalSection)
+void CustomLockRelease(CustomLock* criticalSection);
+
+CustomLock customLock01;
+
+_Requires_lock_held_(customLock01) void DoTaskWithCustomLock();
+
+void DoTask()
+{
+ CustomLockAcquire(&customLock01);
+ DoTaskWithCustomLock();
+ CustomLockRelease(&customLock01);
+}
+```
\ No newline at end of file
diff --git a/docs/code-quality/c26135.md b/docs/code-quality/c26135.md
index bbd4c04054..96db147d01 100644
--- a/docs/code-quality/c26135.md
+++ b/docs/code-quality/c26135.md
@@ -25,14 +25,14 @@ typedef struct _DATA
void MyEnter(DATA* p)
{
// Warning C26135:
- // Missing side effect annotation _Acquires_lock_(&p->cs)
+ // Missing side effect annotation _Acquires_lock_(p->cs)
EnterCriticalSection(&p->cs);
}
void MyLeave(DATA* p)
{
// warning C26135:
- // Missing side effect annotation _Releases_lock_(&p->cs)
+ // Missing side effect annotation _Releases_lock_(p->cs)
LeaveCriticalSection(&p->cs);
}
```
diff --git a/docs/code-quality/c26401.md b/docs/code-quality/c26401.md
index ef45225be5..023338c378 100644
--- a/docs/code-quality/c26401.md
+++ b/docs/code-quality/c26401.md
@@ -63,7 +63,7 @@ public:
ref_count_--;
if (ref_count_ == 0)
{
- [[gsl::suppress(i.11)]]
+ [[gsl::suppress("i.11")]]
delete this;
}
}
diff --git a/docs/code-quality/c26409.md b/docs/code-quality/c26409.md
index 8939a08776..a0dc4a4f3d 100644
--- a/docs/code-quality/c26409.md
+++ b/docs/code-quality/c26409.md
@@ -1,10 +1,9 @@
---
-description: "Learn more about CppCoreCheck rule C26409: avoid explicit new and delete."
title: Warning C26409
+description: "Learn more about CppCoreCheck rule C26409: avoid explicit new and delete."
ms.date: 12/14/2020
f1_keywords: ["C26409", "NO_NEW_DELETE"]
helpviewer_keywords: ["C26409"]
-ms.assetid: a3b3a229-d566-4be3-bd28-2876ccc8dc37
---
# Warning C26409
@@ -13,7 +12,7 @@ ms.assetid: a3b3a229-d566-4be3-bd28-2876ccc8dc37
Even if code is clean of calls to `malloc` and `free`, we still suggest that you consider better options than explicit use of operators [`new` and `delete`](../cpp/new-and-delete-operators.md).
**C++ Core Guidelines**:\
-[R.11: Avoid calling new and delete explicitly](https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#r11-avoid-calling-new-and-delete-explicitly)
+[R.11: Avoid calling `new` and `delete` explicitly](https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#r11-avoid-calling-new-and-delete-explicitly)
The ultimate fix is to use smart pointers and appropriate factory functions, such as [`std::make_unique`](../standard-library/memory-functions.md#make_unique).
@@ -49,7 +48,7 @@ public:
ref_count_--;
if (ref_count_ == 0)
{
- [[gsl::suppress(i.11)]]
+ [[gsl::suppress("i.11")]]
delete this;
}
}
diff --git a/docs/code-quality/c26414.md b/docs/code-quality/c26414.md
index 471b69d1d9..d33427adcb 100644
--- a/docs/code-quality/c26414.md
+++ b/docs/code-quality/c26414.md
@@ -4,14 +4,13 @@ description: "Reference for Visual Studio C++ Core Guidelines code analysis warn
ms.date: 01/29/2020
f1_keywords: ["C26414", "RESET_LOCAL_SMART_PTR"]
helpviewer_keywords: ["C26414"]
-ms.assetid: dd875d0c-6752-4491-a533-3e8831795fbc
---
# Warning C26414
> "Move, copy, reassign or reset a local smart pointer."
**C++ Core Guidelines**:\
-[R.5: Prefer scoped objects, don't heap-allocate unnecessarily](https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Rr-scoped)
+[R.5: Prefer scoped objects, don't heap-allocate unnecessarily](https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#r5-prefer-scoped-objects-dont-heap-allocate-unnecessarily)
Smart pointers are convenient for dynamic resource management, but they're not always necessary. For example, it may be easier and more efficient to manage a local dynamic buffer by using a standard container. You may not need dynamic allocation at all for single objects, for example, if they never outlive their creator function. They can be replaced with local variables. Smart pointers become handy when a scenario requires a change of ownership. For example, when you reassign a dynamic resource multiple times, or in multiple paths. They're also useful for resources obtained from external code. And, when smart pointers are used to extend the lifetime of a resource.
diff --git a/docs/code-quality/c26432.md b/docs/code-quality/c26432.md
index 51dba4ebdc..b9de0b8929 100644
--- a/docs/code-quality/c26432.md
+++ b/docs/code-quality/c26432.md
@@ -4,14 +4,13 @@ description: "Microsoft C++ Code Analysis warning C26432 for the C++ Core Guidel
ms.date: 11/15/2017
f1_keywords: ["C26432", "DEFINE_OR_DELETE_SPECIAL_OPS"]
helpviewer_keywords: ["C26432"]
-ms.assetid: f587b05a-5c69-4176-baa6-fcb79d228b24
---
# Warning C26432
> `If you define or delete any default operation in the type 'type-name', define or delete them all (c.21).`
**C++ Core Guidelines**:\
-[C.21: If you define or =delete any default operation, define or =delete them all](https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#c21-if-you-define-or-delete-any-default-operation-define-or-delete-them-all)
+[C.21: If you define or `=delete` any copy, move, or destructor function, define or `=delete` them all](https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#c21-if-you-define-or-delete-any-copy-move-or-destructor-function-define-or-delete-them-all)
Special operations such as constructors are assumed to alter the behavior of types so they rely more on language mechanisms to automatically enforce specific scenarios. The canonical example is resource management. If you explicitly define, default, or delete any of these special operations, it signals you want to avoid any special handling of a type. It's inconsistent to leave the other operations unspecified, that is, implicitly defined as deleted by the compiler.
diff --git a/docs/code-quality/c26434.md b/docs/code-quality/c26434.md
index 7db222af1a..0bdfe9d173 100644
--- a/docs/code-quality/c26434.md
+++ b/docs/code-quality/c26434.md
@@ -4,7 +4,6 @@ description: "Microsoft C++ Code Analysis warning C26434 for the C++ Core Guidel
ms.date: 08/21/2020
f1_keywords: ["C26434", "DONT_HIDE_METHODS"]
helpviewer_keywords: ["C26434"]
-ms.assetid: 7f66477f-da66-444a-a6e3-44513d7d7e31
---
# Warning C26434
@@ -44,5 +43,4 @@ struct Derived : Base
void not_virtual() noexcept {} // C26434, hides a non-virtual function
virtual void not_virtual(int i) noexcept {} // C26434, and parameters ignored
};
-
```
diff --git a/docs/code-quality/c26435.md b/docs/code-quality/c26435.md
index f66dacda9a..ab4ec78c93 100644
--- a/docs/code-quality/c26435.md
+++ b/docs/code-quality/c26435.md
@@ -7,7 +7,7 @@ helpviewer_keywords: ["C26435"]
---
# Warning C26435
-> Function '*symbol*' should specify exactly one of 'virtual', 'override', or 'final' (c.128)
+> The virtual function '*symbol*' should specify exactly one of 'virtual', 'override', or 'final' (c.128)
## C++ Core Guidelines
@@ -41,6 +41,9 @@ public:
void Draw() override final { // C26435, only 'final' is necessary.
//...
}
+ virtual void DrawCircumference() final { // C26435, should be neither 'virtual' nor 'final'.
+ //...
+ }
};
```
diff --git a/docs/code-quality/c26437.md b/docs/code-quality/c26437.md
index 5757f17f66..2f96db0776 100644
--- a/docs/code-quality/c26437.md
+++ b/docs/code-quality/c26437.md
@@ -4,14 +4,13 @@ description: "Learn more about: Warning C26437 DONT_SLICE"
ms.date: 05/17/2023
f1_keywords: ["C26437", "DONT_SLICE"]
helpviewer_keywords: ["C26437"]
-ms.assetid: ed2f55bc-a6d8-4cc4-8069-5c96e581a96a
---
# Warning C26437
> Do not slice.
**C++ Core Guidelines**:
-[ES.63: Don't slice](https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Res-slice)
+[ES.63: Don't slice](https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#es63-dont-slice)
The language allows [slicing](https://en.wikipedia.org/wiki/Object_slicing) and can be viewed as a special case of a dangerous implicit cast. Even if it's done intentionally and doesn't lead to immediate issues, it's still highly discouraged. It makes code harder to change, by forcing extra requirements on related data types. It's especially true if types are polymorphic or involve resource management.
diff --git a/docs/code-quality/c26439.md b/docs/code-quality/c26439.md
index 68ee27f512..85e7499a1e 100644
--- a/docs/code-quality/c26439.md
+++ b/docs/code-quality/c26439.md
@@ -4,13 +4,12 @@ description: CppCoreCheck rule C26439 that enforces C++ Core Guidelines F.6
ms.date: 05/17/2023
f1_keywords: ["C26439", "SPECIAL_NOEXCEPT"]
helpviewer_keywords: ["C26439"]
-ms.assetid: 9df2a1b0-ea94-4884-9d28-c1522ec33a1b
---
# Warning C26439
> This kind of function may not throw. Declare it 'noexcept'.
-[**C++ Core Guidelines** F.6](https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Rf-noexcept): If your function must not throw, declare it `noexcept`
+[F.6: If your function must not throw, declare it `noexcept`](https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#f6-if-your-function-must-not-throw-declare-it-noexcept)
Some operations should never throw exceptions. Their implementations should be reliable and should handle possible errors conditions gracefully. They shouldn't use exceptions to indicate failure. This rule flags cases where such operations aren't explicitly marked as `noexcept`, which means that they may throw exceptions and consumers can't make assumptions about its reliability.
@@ -63,5 +62,5 @@ struct S
## See also
-[C26455](./c26455.md)\
-[**C++ Core Guidelines** F.6](https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Rf-noexcept)
\ No newline at end of file
+[C26455](c26455.md)\
+[F.6: If your function must not throw, declare it `noexcept`](https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#f6-if-your-function-must-not-throw-declare-it-noexcept)
diff --git a/docs/code-quality/c26441.md b/docs/code-quality/c26441.md
index 75b08a780d..c2f5dc91b8 100644
--- a/docs/code-quality/c26441.md
+++ b/docs/code-quality/c26441.md
@@ -11,7 +11,7 @@ helpviewer_keywords: ["C26441"]
## C++ Core Guidelines
-[CP.44](https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#cp44-remember-to-name-your-lock_guards-and-unique_locks): Remember to name your `lock_guard`s and `unique_lock`s
+[CP.44: Remember to name your `lock_guard`s and `unique_lock`s](https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#cp44-remember-to-name-your-lock_guards-and-unique_locks)
## Remarks
diff --git a/docs/code-quality/c26444.md b/docs/code-quality/c26444.md
index 86c5a32949..cc020442fe 100644
--- a/docs/code-quality/c26444.md
+++ b/docs/code-quality/c26444.md
@@ -11,7 +11,7 @@ helpviewer_keywords: ["C26444"]
## C++ Core Guidelines
-[ES.84: Don't (try to) declare a local variable with no name](https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Res-noname)
+[ES.84: Don't try to declare a local variable with no name](https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#es84-dont-try-to-declare-a-local-variable-with-no-name)
An unnamed variable declaration creates a temporary object that is discarded at the end of the statement. Such temporary objects with nontrivial behavior may point to either inefficient code that allocates and immediately throws away resources or to the code that unintentionally ignores nonprimitive data. Sometimes it may also indicate plainly wrong declaration.
@@ -46,4 +46,4 @@ void Foo()
## See also
[C26441](C26441.md)\
-[ES.84: Don't (try to) declare a local variable with no name](https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Res-noname)
+[ES.84: Don't try to declare a local variable with no name](https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#es84-dont-try-to-declare-a-local-variable-with-no-name)
diff --git a/docs/code-quality/c26449.md b/docs/code-quality/c26449.md
index 594025669c..85de9ef0c3 100644
--- a/docs/code-quality/c26449.md
+++ b/docs/code-quality/c26449.md
@@ -9,7 +9,7 @@ helpviewer_keywords: ["C26449"]
> `gsl::span` or `std::string_view` created from a temporary will be invalid when the temporary is invalidated (gsl.view)
-C++ Core Guidelines: [GSL.view: Views](https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#SS-views).
+C++ Core Guidelines: [GSL.view: Views](https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#gslview-views).
Spans and views are convenient and lightweight types that allow you to reference memory buffers. But they must be used carefully: while their interface looks similar to standard containers, their behavior is more like the behavior of pointers and references. They don't own data and must never be constructed from temporary buffers. This check focuses on cases where source data is temporary, while a span or view isn't. This rule can help to avoid subtle but dangerous mistakes made when legacy code gets modernized and adopts spans or views. There's another check that handles a slightly different scenario involving span references: [C26445 NO_SPAN_REF](c26445.md).
diff --git a/docs/code-quality/c26450.md b/docs/code-quality/c26450.md
index ec01abc830..66044efb23 100644
--- a/docs/code-quality/c26450.md
+++ b/docs/code-quality/c26450.md
@@ -43,8 +43,8 @@ long long multiply()
## See also
-[26451](c26451.md)\
-[26452](c26452.md)\
-[26453](c26453.md)\
-[26454](c26454.md)\
-[ES.103: Don't overflow](https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Res-overflow)
+[C26451](c26451.md)\
+[C26452](c26452.md)\
+[C26453](c26453.md)\
+[C26454](c26454.md)\
+[ES.103: Don't overflow](https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#es103-dont-overflow)
diff --git a/docs/code-quality/c26451.md b/docs/code-quality/c26451.md
index 725ce91a6c..0067e42718 100644
--- a/docs/code-quality/c26451.md
+++ b/docs/code-quality/c26451.md
@@ -45,8 +45,8 @@ void leftshift(int i) noexcept
## See also
-[26450](c26450.md)\
-[26452](c26452.md)\
-[26453](c26453.md)\
-[26454](c26454.md)\
+[C26450](c26450.md)\
+[C26452](c26452.md)\
+[C26453](c26453.md)\
+[C26454](c26454.md)\
[ES.103: Don't overflow](https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#Res-overflow)
diff --git a/docs/code-quality/c26452.md b/docs/code-quality/c26452.md
index d6f004eaa5..0f529f60ce 100644
--- a/docs/code-quality/c26452.md
+++ b/docs/code-quality/c26452.md
@@ -37,9 +37,9 @@ unsigned long long combine(unsigned lo, unsigned hi)
## See also
-[26450](c26450.md)\
-[26451](c26451.md)\
-[26453](c26453.md)\
-[26454](c26454.md)\
-[ES.101: Use unsigned types for bit manipulation](https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Res-unsigned)\
-[ES.102: Use signed types for arithmetic](https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Res-signed)
+[C26450](c26450.md)\
+[C26451](c26451.md)\
+[C26453](c26453.md)\
+[C26454](c26454.md)\
+[ES.101: Use unsigned types for bit manipulation](https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#es101-use-unsigned-types-for-bit-manipulation)\
+[ES.102: Use signed types for arithmetic](https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#es102-use-signed-types-for-arithmetic)
diff --git a/docs/code-quality/c26453.md b/docs/code-quality/c26453.md
index 7012f697ae..32a7064209 100644
--- a/docs/code-quality/c26453.md
+++ b/docs/code-quality/c26453.md
@@ -39,9 +39,9 @@ void leftshift(int shiftCount)
## See also
-[26450](c26450.md)\
-[26451](c26451.md)\
-[26452](c26452.md)\
-[26454](c26454.md)\
-[ES.101: Use unsigned types for bit manipulation](https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Res-unsigned)\
-[ES.102: Use signed types for arithmetic](https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Res-signed)
+[C26450](c26450.md)\
+[C26451](c26451.md)\
+[C26452](c26452.md)\
+[C26454](c26454.md)\
+[ES.101: Use unsigned types for bit manipulation](https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#es101-use-unsigned-types-for-bit-manipulation)\
+[ES.102: Use signed types for arithmetic](https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#es102-use-signed-types-for-arithmetic)
diff --git a/docs/code-quality/c26454.md b/docs/code-quality/c26454.md
index 15940afe9e..77b21092ec 100644
--- a/docs/code-quality/c26454.md
+++ b/docs/code-quality/c26454.md
@@ -1,6 +1,6 @@
---
-description: "Learn more about: Arithmetic overflow: 'operator' operation produces a negative unsigned result at compile time"
title: Warning C26454
+description: "Learn more about: Arithmetic overflow: 'operator' operation produces a negative unsigned result at compile time"
ms.date: 01/08/2017
f1_keywords: ["C26454", "RESULT_OF_ARITHMETIC_OPERATION_NEGATIVE_UNSIGNED"]
helpviewer_keywords: ["C26454"]
@@ -37,8 +37,8 @@ unsigned int negativeunsigned()
## See also
-[26450](c26450.md)\
-[26451](c26451.md)\
-[26452](c26452.md)\
-[26453](c26453.md)\
-[ES.106: Don't try to avoid negative values by using unsigned](https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Res-nonnegative)
+[C26450](c26450.md)\
+[C26451](c26451.md)\
+[C26452](c26452.md)\
+[C26453](c26453.md)\
+[ES.106: Don't try to avoid negative values by using `unsigned`](https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#es106-dont-try-to-avoid-negative-values-by-using-unsigned)
diff --git a/docs/code-quality/c26455.md b/docs/code-quality/c26455.md
index ca27f3e0e2..617f0cedd5 100644
--- a/docs/code-quality/c26455.md
+++ b/docs/code-quality/c26455.md
@@ -4,7 +4,6 @@ description: "Learn more about the C26455 DEFAULT_CTOR_NOEXCEPT"
ms.date: 04/29/2022
f1_keywords: ["C26455", "DEFAULT_CTOR_NOEXCEPT"]
helpviewer_keywords: ["C26455"]
-ms.assetid: 27e86063-d969-49d8-8912-dcc2dc57249f
author: kylereedmsft
ms.author: kylereed
ms.custom: kr2b-contr-experiment
@@ -24,4 +23,4 @@ Code analysis name: `DEFAULT_CTOR_NOEXCEPT`
## See also
[C26439](./c26439.md)\
-[**C++ Core Guidelines** F.6](https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Rf-noexcept)
+[F.6: If your function must not throw, declare it `noexcept`](https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#f6-if-your-function-must-not-throw-declare-it-noexcept)
diff --git a/docs/code-quality/c26478.md b/docs/code-quality/c26478.md
index e9c680bfad..ddaff2f01b 100644
--- a/docs/code-quality/c26478.md
+++ b/docs/code-quality/c26478.md
@@ -1,6 +1,6 @@
---
-description: "Learn more about: Warning C26478: Don't use std::move on constant variables. (es.56)"
title: Warning C26478
+description: "Learn more about: Warning C26478: Don't use std::move on constant variables. (es.56)"
ms.date: 10/12/2023
f1_keywords: ["C26478", "NO_MOVE_OP_ON_CONST"]
helpviewer_keywords: ["C26478"]
@@ -37,4 +37,4 @@ To fix the issue, remove the redundant `std::move`.
## See also
-[ES.56 - Write `std::move()` only when you need to explicitly move an object to another scope](https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Res-move)
+[ES.56: Write `std::move()` only when you need to explicitly move an object to another scope](https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#es56-write-stdmove-only-when-you-need-to-explicitly-move-an-object-to-another-scope)
diff --git a/docs/code-quality/c26479.md b/docs/code-quality/c26479.md
index 336a12c33b..4612d6fea0 100644
--- a/docs/code-quality/c26479.md
+++ b/docs/code-quality/c26479.md
@@ -1,6 +1,6 @@
---
-description: "Learn more about: Warning C26479: Don't use std::move to return a local variable. (f.48)"
title: Warning C26479
+description: "Learn more about: Warning C26479: Don't use std::move to return a local variable. (f.48)"
ms.date: 10/12/2023
f1_keywords: ["C26479", "NO_MOVE_RET_ON_LOCALS"]
helpviewer_keywords: ["C26479"]
@@ -38,5 +38,5 @@ S foo()
## See also
-[F.48 - Don't return `std::move(local)`](https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Rf-return-move-local)
-[ES.56 - Write `std::move()` only when you need to explicitly move an object to another scope](https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Res-move)
+[F.48: Don't `return std::move(local)`](https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#f48-dont-return-stdmovelocal)\
+[ES.56: Write `std::move()` only when you need to explicitly move an object to another scope](https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#es56-write-stdmove-only-when-you-need-to-explicitly-move-an-object-to-another-scope)
diff --git a/docs/code-quality/c26483.md b/docs/code-quality/c26483.md
index ea4c10c6b9..5e031b2448 100644
--- a/docs/code-quality/c26483.md
+++ b/docs/code-quality/c26483.md
@@ -1,9 +1,9 @@
---
title: Warning C26483
+description: CppCoreCheck rule C26483 that enforces C++ Core Guidelines Bounds.2
ms.date: 03/22/2018
f1_keywords: ["C26483", "STATIC_INDEX_OUT_OF_RANGE"]
helpviewer_keywords: ["C26483"]
-description: CppCoreCheck rule C26483 that enforces C++ Core Guidelines Bounds.2
---
# Warning C26483
@@ -24,5 +24,4 @@ void function()
int arr2[] { 1, 2, 3 };
arr2[3] = 4; // C26483, 3 is outside the bounds of the array
}
-
```
diff --git a/docs/code-quality/c26488.md b/docs/code-quality/c26488.md
index b3ae0ce888..a54608facb 100644
--- a/docs/code-quality/c26488.md
+++ b/docs/code-quality/c26488.md
@@ -1,10 +1,9 @@
---
-description: "Learn more about: Warning C26488 LIFETIMES_DEREF_NULL_POINTER"
title: Warning C26488
+description: "Learn more about: Warning C26488 LIFETIMES_DEREF_NULL_POINTER"
ms.date: 12/14/2018
f1_keywords: ["C26488", "LIFETIMES_DEREF_NULL_POINTER"]
helpviewer_keywords: ["C26488"]
-ms.assetid: 2ade0d31-f259-49de-8676-cce6092fabfc
author: kylereedmsft
ms.author: kylereed
---
@@ -28,9 +27,9 @@ void ex1()
The Lifetime guidelines from the C++ core guidelines outline a contract that code can follow which will enable more thorough static memory leak and dangling pointer detection. The basic ideas behind the guidelines are:
-1) Never dereference an invalid (dangling) or known-null pointer
-2) Never return (either formal return or out parameter) any pointer from a function.
-3) Never pass an invalid (dangling) pointer to any function.
+1. Never dereference an invalid (dangling) or known-null pointer.
+1. Never return (either formal return or out parameter) any pointer from a function.
+1. Never pass an invalid (dangling) pointer to any function.
## See also
diff --git a/docs/code-quality/c26489.md b/docs/code-quality/c26489.md
index 2f252dc766..85df9e569a 100644
--- a/docs/code-quality/c26489.md
+++ b/docs/code-quality/c26489.md
@@ -1,10 +1,9 @@
---
-description: "Learn more about: Warning C26489 LIFETIMES_DEREF_INVALID_POINTER"
title: Warning C26489
+description: "Learn more about: Warning C26489 LIFETIMES_DEREF_INVALID_POINTER"
ms.date: 12/14/2018
f1_keywords: ["C26489", "LIFETIMES_DEREF_INVALID_POINTER"]
helpviewer_keywords: ["C26489"]
-ms.assetid: 15983d4f-f615-42e7-8521-ee094b87d066
author: kylereedmsft
ms.author: kylereed
---
@@ -30,9 +29,9 @@ int ex1()
The Lifetime guidelines from the C++ core guidelines outline a contract that code can follow which will enable more thorough static memory leak and dangling pointer detection. The basic ideas behind the guidelines are:
-1) Never dereference an invalid (dangling) or known-null pointer
-2) Never return (either formal return or out parameter) any pointer from a function.
-3) Never pass an invalid (dangling) pointer to any function.
+1. Never dereference an invalid (dangling) or known-null pointer.
+1. Never return (either formal return or out parameter) any pointer from a function.
+1. Never pass an invalid (dangling) pointer to any function.
## See also
diff --git a/docs/code-quality/c26494.md b/docs/code-quality/c26494.md
index 100acee105..7ed21fb002 100644
--- a/docs/code-quality/c26494.md
+++ b/docs/code-quality/c26494.md
@@ -37,5 +37,5 @@ void function()
## See also
-[ES.20: Always initialize an object](https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Res-always)\
-[C++ Core Guidelines Type.5](https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#prosafety-type-safety-profile)
+[ES.20: Always initialize an object](https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#es20-always-initialize-an-object)\
+[Pro.safety: Type-safety profile](https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#prosafety-type-safety-profile)
diff --git a/docs/code-quality/c26498.md b/docs/code-quality/c26498.md
index 8277d9601c..e495372145 100644
--- a/docs/code-quality/c26498.md
+++ b/docs/code-quality/c26498.md
@@ -9,7 +9,7 @@ helpviewer_keywords: ["C26498"]
> The function '*function*' is constexpr, mark variable '*variable*' constexpr if compile-time evaluation is desired (con.5)
-This rule helps to enforce Con.5 from the [C++ Core Guidelines](https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Rconst-constexpr): use constexpr for values that can be computed at compile time.
+This rule helps to enforce [Con.5: Use `constexpr` for values that can be computed at compile time](https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#con5-use-constexpr-for-values-that-can-be-computed-at-compile-time) in the C++ Core Guidelines.
## Remarks
@@ -58,6 +58,6 @@ void foo()
## See also
-[C26497](./c26407.md)\
-[C26814](./c26814.md)\
-[Con.5](https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Rconst-constexpr)
\ No newline at end of file
+[C26497](c26407.md)\
+[C26814](c26814.md)\
+[Con.5: Use `constexpr` for values that can be computed at compile time](https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#con5-use-constexpr-for-values-that-can-be-computed-at-compile-time)
diff --git a/docs/code-quality/c26815.md b/docs/code-quality/c26815.md
index 8778703ae4..5a8c319b65 100644
--- a/docs/code-quality/c26815.md
+++ b/docs/code-quality/c26815.md
@@ -78,4 +78,4 @@ void f() {
## See also
[C26816](c26816.md)\
-[ES.65: Don't dereference an invalid pointer](https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Res-deref)
+[ES.65: Don't dereference an invalid pointer](https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#es65-dont-dereference-an-invalid-pointer)
diff --git a/docs/code-quality/c26816.md b/docs/code-quality/c26816.md
index f01ea3bc00..f60d02ef09 100644
--- a/docs/code-quality/c26816.md
+++ b/docs/code-quality/c26816.md
@@ -62,4 +62,4 @@ int f() {
## See also
[C26815](c26815.md)\
-[ES.65: Don't dereference an invalid pointer](https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Res-deref)
+[ES.65: Don't dereference an invalid pointer](https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#es65-dont-dereference-an-invalid-pointer)
diff --git a/docs/code-quality/c26817.md b/docs/code-quality/c26817.md
index fd72d2a527..3e66b660cf 100644
--- a/docs/code-quality/c26817.md
+++ b/docs/code-quality/c26817.md
@@ -9,7 +9,7 @@ helpviewer_keywords: ["C26817"]
> Potentially expensive copy of variable *name* in range-for loop. Consider making it a const reference (es.71).
-For more information, see [ES.71 notes](https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Res-for-range) in the C++ Core Guidelines.
+For more information, see [ES.71: Prefer a range-`for`-statement to a `for`-statement when there is a choice](https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#es71-prefer-a-range-for-statement-to-a-for-statement-when-there-is-a-choice) in the C++ Core Guidelines.
## Example
diff --git a/docs/code-quality/c26819.md b/docs/code-quality/c26819.md
index 34dcd15ac7..fea652f765 100644
--- a/docs/code-quality/c26819.md
+++ b/docs/code-quality/c26819.md
@@ -13,7 +13,7 @@ helpviewer_keywords: ["C26819"]
This check covers implicit fallthrough in switch statements. Implicit fallthrough is when control flow transfers from one switch case directly into a following switch case without the use of the `[[fallthrough]];` statement. This warning is raised when an implicit fallthrough is detected in a switch case containing at least one statement.
-For more information, see [ES.78: Don't rely on implicit fallthrough in `switch` statements](https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Res-break) in the C++ Core Guidelines.
+For more information, see [ES.78: Don't rely on implicit fallthrough in `switch` statements](https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#es78-dont-rely-on-implicit-fallthrough-in-switch-statements) in the C++ Core Guidelines.
## Example
@@ -87,4 +87,4 @@ void foo(int a)
## See also
-[ES.78: Don't rely on implicit fallthrough in `switch` statements](https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Res-break)
\ No newline at end of file
+[ES.78: Don't rely on implicit fallthrough in `switch` statements](https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#es78-dont-rely-on-implicit-fallthrough-in-switch-statements)
diff --git a/docs/code-quality/c26820.md b/docs/code-quality/c26820.md
index 291f3abc21..133edaf130 100644
--- a/docs/code-quality/c26820.md
+++ b/docs/code-quality/c26820.md
@@ -9,7 +9,7 @@ helpviewer_keywords: ["C26820"]
> This is a potentially expensive copy operation. Consider using a reference unless a copy is required (p.9)
-For more information, see [P.9: Don't waste time or space](https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Rp-waste) in the C++ Core Guidelines.
+For more information, see [P.9: Don't waste time or space](https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#p9-dont-waste-time-or-space) in the C++ Core Guidelines.
This check covers nonobvious and easy-to-miss behavior when assigning a reference to a variable marked **`auto`**. The type of the **`auto`** variable is resolved to a value rather than a reference, and an implicit copy is made.
diff --git a/docs/code-quality/c26826.md b/docs/code-quality/c26826.md
index 8c0f827e9d..47fd2d9e8d 100644
--- a/docs/code-quality/c26826.md
+++ b/docs/code-quality/c26826.md
@@ -9,7 +9,7 @@ helpviewer_keywords: ["C26826"]
> Don't use C-style variable arguments (f.55).
-For more information, see [F.55: Don't use `va_arg` arguments](https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#F-varargs) in the C++ Core Guidelines.
+For more information, see [F.55: Don't use `va_arg` arguments](https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#f55-dont-use-va_arg-arguments) in the C++ Core Guidelines.
## Remarks
diff --git a/docs/code-quality/c26831.md b/docs/code-quality/c26831.md
index 0fe737b017..fba6057d2f 100644
--- a/docs/code-quality/c26831.md
+++ b/docs/code-quality/c26831.md
@@ -58,4 +58,6 @@ void foo(int i, int j)
## See also
[`C26832`](c26832.md)\
-[`C26833`](c26833.md)
\ No newline at end of file
+[`C26833`](c26833.md)\
+[`C26838`](c26838.md)\
+[`C26839`](c26839.md)
\ No newline at end of file
diff --git a/docs/code-quality/c26837.md b/docs/code-quality/c26837.md
index 021978ff09..2be95d94db 100644
--- a/docs/code-quality/c26837.md
+++ b/docs/code-quality/c26837.md
@@ -1,6 +1,6 @@
---
-description: "Learn more about: Warning C26837"
title: Warning C26837
+description: "Learn more about: Warning C26837"
ms.date: 11/29/2023
f1_keywords: ["C26837", "INTERLOCKED_COMPARE_EXCHANGE_MISUSE", "__WARNING_INTERLOCKED_COMPARE_EXCHANGE_MISUSE"]
helpviewer_keywords: ["C26837"]
@@ -34,7 +34,7 @@ The intent of this code is:
1. Check if this current value has the least significant bit set.
1. If it does have least significant bit set, clear the bit while preserving the other bits of the current value.
-To accomplish this, a copy of the current value is read from the`plock` pointer and saved to a stack variable `lock`. `lock` is used three times:
+To accomplish this, a copy of the current value is read from the `plock` pointer and saved to a stack variable `lock`. `lock` is used three times:
1. First, to check if the least-significant bit is set.
1. Second, as the `Comparand` value to `InterlockedCompareExchange64`.
diff --git a/docs/code-quality/c26838.md b/docs/code-quality/c26838.md
new file mode 100644
index 0000000000..652ec704cd
--- /dev/null
+++ b/docs/code-quality/c26838.md
@@ -0,0 +1,62 @@
+---
+title: Warning C26838
+description: Learn about Microsoft C++ code analysis warning C26838.
+author: Rastaban
+ms.author: philc
+ms.topic: reference
+ms.date: 1/10/2025
+---
+# Warning C26838
+
+> Allocation size is the result of a signed to unsigned narrowing conversion that could result in overflow if the signed value is negative.
+
+This warning was added in Visual Studio 2022 version 17.13.
+
+## Remarks
+
+Reports that the size specified for an allocation may be the result of the conversion of a possibly negative signed value to an unsigned value. For example:
+
+```cpp
+void* CustomAlloc(size_t);
+
+int* CreateIntArray(int numberOfElements)
+{
+ int* p = (int*)CustomAlloc(numberOfElements * sizeof(int)); // Warning: C26838
+
+ return p;
+}
+```
+
+The expression `numberOfElements * sizeof(int)`, `numberOfElements` is signed and `sizeof(int)` is unsigned. On 64-bit machines, `numberOfElements` is promoted to an unsigned value when multiplied
+by `sizeof(int)`. When `numberOfElements` is negative, the resulting value may overflow or have unexpected results when passed to `CustomAlloc`.
+
+This check applies to common allocation functions like `new`, `malloc`, and `VirtualAlloc`. The check also applies to custom allocator functions that have `alloc` (case insensitive) in the function name.
+
+This check sometimes fails to recognize that certain checks can prevent overflows because the check is conservative.
+
+## Example
+
+To fix the previous code example in which `numberOfElements * sizeof(int)` might overflow due to a negative signed value, introduce a check to ensure it won't. For example:
+
+```cpp
+void* CustomAlloc(size_t);
+
+int* CreateIntArray(int numberOfElements)
+{
+ if (numberOfElements < 0)
+ return nullptr;
+
+ int* p = (int*)CustomAlloc(numberOfElements * sizeof(int));
+ // ...
+ return p;
+}
+```
+
+In the previous example, checking for a negative value addresses the `C26832` warning. Depending on the size of the types involved, this check may result in a different warning such as [`C26831`](c26831.md). For example, on a 32-bit system, both `int` and `size_t` are 32 bits, so the result of the multiplication can still overflow without negative values.
+
+## See also
+
+[`C26831`](c26831.md)\
+[`C26832`](c26832.md)\
+[`C26833`](c26833.md)\
+[`C26833`](c26839.md)
\ No newline at end of file
diff --git a/docs/code-quality/c26839.md b/docs/code-quality/c26839.md
new file mode 100644
index 0000000000..96d47c6df2
--- /dev/null
+++ b/docs/code-quality/c26839.md
@@ -0,0 +1,53 @@
+---
+title: Warning C26839
+description: Learn about Microsoft C++ code analysis warning C26839.
+author: Rastaban
+ms.author: philc
+ms.topic: reference
+ms.date: 1/10/2025
+---
+# Warning C26839
+
+> Array new allocation size is the result of a signed to unsigned narrowing conversion that could result in overflow if the signed value is negative.
+
+This warning was added in Visual Studio 2022 version 17.13.
+
+## Remarks
+
+Reports that the size specified for an array `new` allocation may be the result of the conversion of a possibly negative signed value to an unsigned value. For example:
+
+```cpp
+int* CreateIntArray(int size)
+{
+ int* intArray = new int[size];
+ return intArray;
+}
+```
+
+The expression `new int[size]`, `size` is signed. The compiler converts the signed value to an unsigned value to calculate how many bytes to be allocated for the array. When `size` is negative, the result of that calculation may overflow or have unexpected results when passed to `new`.
+
+This check is the same as [`C26838`](c26838.md), but applies only to `new T[]`.
+
+This check sometimes fails to recognize that certain checks can prevent overflows because the check is conservative.
+
+## Example
+
+To fix the previous code example in which the size calculation might overflow due to a negative signed value, introduce a check to ensure it won't. For example:
+
+```cpp
+int* CreateIntArray(int size)
+{
+ if (size < 0)
+ return nullptr;
+
+ int* intArray = new int[size];
+ return intArray;
+}
+```
+
+## See also
+
+[`C26831`](c26831.md)\
+[`C26832`](c26832.md)\
+[`C26838`](c26833.md)\
+[`C26838`](c26838.md)
\ No newline at end of file
diff --git a/docs/code-quality/c28020.md b/docs/code-quality/c28020.md
index d3597bd143..927e462bda 100644
--- a/docs/code-quality/c28020.md
+++ b/docs/code-quality/c28020.md
@@ -1,15 +1,32 @@
---
-description: "Learn more about: Warning C28020"
title: Warning C28020
-ms.date: 11/04/2016
+description: "Learn more about: Warning C28020"
+ms.date: 03/25/2025
f1_keywords: ["C28020"]
helpviewer_keywords: ["C28020"]
-ms.assetid: 3612185a-0858-4ba9-b795-4a0681073cf7
---
# Warning C28020
-> The expression '*expr*' is not true at this call
+> The expression '*expr*' is not true at this call.
This warning is reported when the `_Satisfies_` expression listed isn't true. Frequently, the warning indicates an incorrect parameter.
If this warning occurs on a function declaration, the annotations indicate an impossible condition.
+
+## Example
+
+The following example generates C28020:
+
+```cpp
+#include
+
+int func(_In_range_(0, 10) int value)
+{
+ return value;
+}
+
+int main()
+{
+ func(11); // C28020
+}
+```
diff --git a/docs/code-quality/c28112.md b/docs/code-quality/c28112.md
index d717ffd596..530ab51bc0 100644
--- a/docs/code-quality/c28112.md
+++ b/docs/code-quality/c28112.md
@@ -1,10 +1,9 @@
---
-description: "Learn more about: Warning C28112"
title: Warning C28112
+description: "Learn more about: Warning C28112"
ms.date: 08/25/2022
f1_keywords: ["C28112", "INTERLOCKED_ACCESS", "__WARNING_INTERLOCKED_ACCESS"]
helpviewer_keywords: ["C28112"]
-ms.assetid: 2720a5dc-84e9-4f78-a8c7-a320c9f9216b
---
# Warning C28112
@@ -16,7 +15,7 @@ A variable that is accessed by using the Interlocked executive support routines,
`InterlockedXxx` functions are intended to provide atomic operations, but are only atomic with respect to other `InterlockedXxx` functions. Although certain ordinary assignments, accesses, and comparisons to variables that are used by the Interlocked\* routines can be safely accessed by using a different function, the risk is great enough to justify examining each instance.
-Code analysis name: INTERLOCKED_ACCESS
+Code analysis name: `INTERLOCKED_ACCESS`
## Example
diff --git a/docs/code-quality/c28159.md b/docs/code-quality/c28159.md
index e17a31ee6f..05fbe31944 100644
--- a/docs/code-quality/c28159.md
+++ b/docs/code-quality/c28159.md
@@ -1,14 +1,13 @@
---
-description: "Learn more about: Warning C28159"
title: Warning C28159
+description: "Learn more about: Warning C28159"
ms.date: 09/08/2022
f1_keywords: ["C28159", "USE_OTHER_FUNCTION", "__WARNING_USE_OTHER_FUNCTION"]
helpviewer_keywords: ["C28159"]
-ms.assetid: fab6cd58-0985-4ef6-89a2-64ed04297437
---
# Warning C28159
-> Consider using `*function_name_1*` instead of `*function_name_2*`. Reason: *reason*
+> Consider using *`function_name_1`* instead of *`function_name_2`*. Reason: *reason*
This warning occurs when you use a function that is semantically equivalent to an alternative, preferred function call.
@@ -16,7 +15,7 @@ This warning occurs when you use a function that is semantically equivalent to a
C28159 is a general warning message; the annotation `__drv_preferredFunction` was used (possibly with a conditional `__drv_when`() annotation) to flag a bad coding practice.
-Code analysis name: USE_OTHER_FUNCTION
+Code analysis name: `USE_OTHER_FUNCTION`
## Example
diff --git a/docs/code-quality/c28160.md b/docs/code-quality/c28160.md
index 38ea9be0b1..eeee7046da 100644
--- a/docs/code-quality/c28160.md
+++ b/docs/code-quality/c28160.md
@@ -1,10 +1,9 @@
---
-description: "Learn more about: Warning C28160"
title: Warning C28160
+description: "Learn more about: Warning C28160"
ms.date: 09/08/2022
f1_keywords: ["C28160", "ERROR", "__WARNING_ERROR"]
helpviewer_keywords: ["C28160"]
-ms.assetid: cab15f6b-909c-4cc8-81a0-c24ac7c91c7c
---
# Warning C28160
@@ -16,4 +15,4 @@ This warning is reported when a `__drv_error` annotation has been encountered.
This annotation is used to flag coding practices that should be fixed, and can be used with a `__drv_when` annotation to indicate specific combinations of parameters.
-Code analysis name: ERROR
+Code analysis name: `ERROR`
diff --git a/docs/code-quality/c28196.md b/docs/code-quality/c28196.md
index 4bd26b4162..388766230a 100644
--- a/docs/code-quality/c28196.md
+++ b/docs/code-quality/c28196.md
@@ -1,10 +1,9 @@
---
-description: "Learn more about: Warning C28196"
title: Warning C28196
+description: "Learn more about: Warning C28196"
ms.date: 11/04/2016
f1_keywords: ["C28196", "RETURNING_BAD_RESULT", "__WARNING_RETURNING_BAD_RESULT"]
helpviewer_keywords: ["C28196"]
-ms.assetid: 5ee89e96-2796-4316-a64c-702463ca1374
---
# Warning C28196
@@ -51,4 +50,4 @@ Item *get_item(_In_reads_(len) Item *items, size_t len, size_t index) {
## See also
[Annotating function parameters and return values](./annotating-function-parameters-and-return-values.md)\
-[Specifying When and Where an Annotation Applies](./specifying-when-and-where-an-annotation-applies.md)\
+[Specifying When and Where an Annotation Applies](./specifying-when-and-where-an-annotation-applies.md)
diff --git a/docs/code-quality/c28310.md b/docs/code-quality/c28310.md
index 4b85718201..30aa4d8244 100644
--- a/docs/code-quality/c28310.md
+++ b/docs/code-quality/c28310.md
@@ -1,9 +1,9 @@
---
-description: "Learn more about: Warning C28310"
title: Warning C28310
+description: "Learn more about: Warning C28310"
ms.date: 11/04/2016
f1_keywords: ["C28310"]
-ms.assetid: 51054ca8-01b6-454b-9853-f05f1c817b18
+helpviewer_keywords: ["C28310"]
---
# Warning C28310
diff --git a/docs/code-quality/c28311.md b/docs/code-quality/c28311.md
index 70e03e716e..9d72006cae 100644
--- a/docs/code-quality/c28311.md
+++ b/docs/code-quality/c28311.md
@@ -1,9 +1,9 @@
---
-description: "Learn more about: Warning C28311"
title: Warning C28311
+description: "Learn more about: Warning C28311"
ms.date: 11/04/2016
f1_keywords: ["C28311"]
-ms.assetid: 2c76e07a-4418-40ef-8a77-c62774bc3677
+helpviewer_keywords: ["C28311"]
---
# Warning C28311
diff --git a/docs/code-quality/c28312.md b/docs/code-quality/c28312.md
index 55f6154d54..852d5bec16 100644
--- a/docs/code-quality/c28312.md
+++ b/docs/code-quality/c28312.md
@@ -1,9 +1,9 @@
---
-description: "Learn more about: Warning C28312"
title: Warning C28312
+description: "Learn more about: Warning C28312"
ms.date: 11/04/2016
f1_keywords: ["C28312"]
-ms.assetid: 19828546-33c9-4373-b7df-2a362ca12637
+helpviewer_keywords: ["C28312"]
---
# Warning C28312
diff --git a/docs/code-quality/c33001.md b/docs/code-quality/c33001.md
index d3208941b4..679ffc1e04 100644
--- a/docs/code-quality/c33001.md
+++ b/docs/code-quality/c33001.md
@@ -13,14 +13,23 @@ helpviewer_keywords: ["C33001"]
## Remarks
-This warning is triggered when an uninitialized `VARIANT` is passed to an API such as `VariantClear`
-that expects an initialized `VARIANT`.
+This warning is triggered when an uninitialized `VARIANT` is passed to an API, such as `VariantClear`, that clears the object. Initialize the `VARIANT` before passing it to these functions so it can be properly cleared.
+
+This warning applies to these functions:
+
+* `VariantClear`
+* `PropVariantClear`
+* `VariantCopy`
+* `VariantCopyInd`
+* `VariantChangeType`
+* `VariantChangeTypeEx`
+* `DestroyPropVariant`
Code analysis name: `VARIANTCLEAR_UNINITIALIZED`
## Example
-The following sample code causes warning C33001:
+The following code causes warning C33001:
```cpp
#include
@@ -36,11 +45,11 @@ HRESULT foo(bool some_condition)
//...
}
- VariantClear(&var); // C33001
+ VariantClear(&var); // C33001
}
```
-These warnings are corrected by ensuring `VariantClear` is called only for a properly initialized `VARIANT`:
+In this example, the warning is corrected by calling `VariantClear` only after `var` has been initialized:
```cpp
#include
@@ -54,12 +63,12 @@ HRESULT foo(bool some_condition)
//...
VariantInit(&var);
//...
- VariantClear(&var); // C33001
+ VariantClear(&var); // OK
}
}
```
## See also
-[C33004](./c33004.md)
+[C33004](./c33004.md)\
[C33005](./c33005.md)
diff --git a/docs/code-quality/c33004.md b/docs/code-quality/c33004.md
index 752103c945..44486d8ffc 100644
--- a/docs/code-quality/c33004.md
+++ b/docs/code-quality/c33004.md
@@ -49,5 +49,5 @@ void t2(_Out_ VARIANT* pv)
## See also
-[C33001](./c33001.md)
+[C33001](./c33001.md)\
[C33005](./c33005.md)
diff --git a/docs/code-quality/c33005.md b/docs/code-quality/c33005.md
index 8c056ba671..41509513e3 100644
--- a/docs/code-quality/c33005.md
+++ b/docs/code-quality/c33005.md
@@ -55,5 +55,5 @@ void foo()
## See also
-[C33001](./c33001.md)
+[C33001](./c33001.md)\
[C33004](./c33004.md)
diff --git a/docs/code-quality/c6029.md b/docs/code-quality/c6029.md
index 85829020b6..729f39ab08 100644
--- a/docs/code-quality/c6029.md
+++ b/docs/code-quality/c6029.md
@@ -1,6 +1,6 @@
---
-description: "Learn more about: Warning C6029"
title: Warning C6029
+description: "Learn more about: Warning C6029"
ms.date: 2/07/2023
f1_keywords: ["C6029", "USING_TAINTED_DATA", "__WARNING_USING_TAINTED_DATA"]
helpviewer_keywords: ["C6029"]
@@ -35,7 +35,7 @@ void processData(FILE* file)
}
```
-The fix for the issue depends on the nature of the data and the behavior of the annotated function that triggers the diagnostic. For more information, see the documentation for that function. A straightforward fix is to check the size before the second call to `std:fread`. In the next example, we throw an exception to terminate the function. Most real-world code would instead have an error recovery strategy that's specific to the scenario.
+The fix for the issue depends on the nature of the data and the behavior of the annotated function that triggers the diagnostic. For more information, see the documentation for that function. A straightforward fix is to check the size before the second call to `std::fread`. In the next example, we throw an exception to terminate the function. Most real-world code would instead have an error recovery strategy that's specific to the scenario.
```cpp
void processData(FILE* file)
@@ -55,7 +55,7 @@ void processData(FILE* file)
}
```
-In `std:fread` and similar functions, the code may need to read large amounts of data. To handle large data, you can allocate the size of the buffer dynamically after the size becomes known. Or, you can call `std:fread` multiple times as needed to read in the rest of the data. If you allocate the buffer dynamically, we recommend you put a limit on the size to avoid introducing an out-of-memory exploit for large values. We don't use this approach in our example because it's already bounded by the size of `uint8_t`.
+In `std::fread` and similar functions, the code may need to read large amounts of data. To handle large data, you can allocate the size of the buffer dynamically after the size becomes known. Or, you can call `std::fread` multiple times as needed to read in the rest of the data. If you allocate the buffer dynamically, we recommend you put a limit on the size to avoid introducing an out-of-memory exploit for large values. We don't use this approach in our example because it's already bounded by the size of `uint8_t`.
```cpp
void processDataDynamic(FILE* file)
diff --git a/docs/code-quality/c6030.md b/docs/code-quality/c6030.md
index 41d536acb3..d839858cfa 100644
--- a/docs/code-quality/c6030.md
+++ b/docs/code-quality/c6030.md
@@ -6,17 +6,18 @@ f1_keywords: ["C6030", "USE_ATTRIBUTE_NORETURN", "__WARNING_USE_ATTRIBUTE_NORETU
helpviewer_keywords: ["C6030"]
---
-# Warning C6030
+# Warning C6030
> Use attribute [[noreturn]] over __declspec(noreturn) in function '*function-name*'
## Remarks
-This warning suggests using the C++11 standard attribute `[[noreturn]]` in place of the declspec variant `__declspec(noreturn)`. The standard attribute provides better cross-platform support because it doesn't rely on language extensions.
+This warning suggests using the C++11 standard attribute [`[[noreturn]]`](../cpp/attributes.md#noreturn) in place of the declspec variant [`__declspec(noreturn)`](../cpp/noreturn.md). The standard attribute provides better cross-platform support because it doesn't rely on language extensions.
This warning is off by default and isn't part of the `All Rules` rule set. To enable this warning, it must be added to the rule set file being used.
This check is available in Visual Studio 2022 version 17.0 and later versions.
+
Code analysis name: `USE_ATTRIBUTE_NORETURN`
## Example
@@ -24,15 +25,13 @@ Code analysis name: `USE_ATTRIBUTE_NORETURN`
The following code generates C6030:
```cpp
-__declspec(noreturn) void TerminateApplication();
-
+__declspec(noreturn) void terminate_application();
```
Fix the issue by using the `[[noreturn]]` attribute:
```cpp
-[[ noreturn ]] void TerminateApplication();
-
+[[noreturn]] void terminate_application();
```
## See also
diff --git a/docs/code-quality/c6102.md b/docs/code-quality/c6102.md
index d1dd840a69..9c35f2bc5a 100644
--- a/docs/code-quality/c6102.md
+++ b/docs/code-quality/c6102.md
@@ -1,9 +1,9 @@
---
-description: "Learn more about: Warning C6102"
title: Warning C6102
+description: "Learn more about: Warning C6102"
ms.date: 11/04/2016
f1_keywords: ["C6102"]
-ms.assetid: cfd49a8c-df46-48de-8dcb-02ecf2450034
+helpviewer_keywords: ["C6102"]
---
# Warning C6102
diff --git a/docs/code-quality/c6103.md b/docs/code-quality/c6103.md
index d348b72bd5..6c9dfdcfcd 100644
--- a/docs/code-quality/c6103.md
+++ b/docs/code-quality/c6103.md
@@ -1,9 +1,9 @@
---
-description: "Learn more about: Warning C6103"
title: Warning C6103
+description: "Learn more about: Warning C6103"
ms.date: 11/04/2016
f1_keywords: ["C6103"]
-ms.assetid: 22d1ab35-31a3-4ba9-8ef4-7a64bce66621
+helpviewer_keywords: ["C6103"]
---
# Warning C6103
diff --git a/docs/code-quality/c6296.md b/docs/code-quality/c6296.md
index c5b5b21acb..e6f7da0340 100644
--- a/docs/code-quality/c6296.md
+++ b/docs/code-quality/c6296.md
@@ -1,47 +1,35 @@
---
-description: "Learn more about: Warning C6296"
title: Warning C6296
-ms.date: 11/04/2016
+description: "Learn more about: Warning C6296"
+ms.date: 03/30/2025
f1_keywords: ["C6296", "LOOP_ONLY_EXECUTED_ONCE", "__WARNING_LOOP_ONLY_EXECUTED_ONCE"]
helpviewer_keywords: ["C6296"]
-ms.assetid: 226573e0-db18-4c44-8fc6-0bc09d1028bc
---
# Warning C6296
-> Ill-defined for-loop: Loop body only executed once
+> Ill-defined for-loop. Loop body only executed once.
## Remarks
-This warning indicates that a for-loop might not function as intended. When the index is unsigned and a loop counts down from zero, its body is run only once.
+This warning indicates that a for-loop might unintentionally execute only once. A loop with an unsigned index counting down from zero or a mistaken use of `==` might cause this warning.
Code analysis name: `LOOP_ONLY_EXECUTED_ONCE`
## Example
-The following code generates this warning:
+The following example generates C6296. Each for-loop shown executes exactly once.
```cpp
-void f( )
+int main()
{
- unsigned int i;
+ for (unsigned int i = 0; i < 10; i--) {} // C6296
+ // Use the following line to resolve the warning:
+ // for (unsigned int i = 0; i < 10; i++) {}
- for (i = 0; i < 100; i--)
- {
- // code ...
- }
-}
-```
+ for (int i = 0; i == 0; i++) {} // C6296
-To correct this warning, use the following code:
-
-```cpp
-void f( )
-{
- unsigned int i;
+ for (int i = 0; i < 1; i++) {} // OK
- for (i = 0; i < 100; i++)
- {
- // code ...
- }
+ for (int i = 1; i > 0; i--) {} // OK
}
```
diff --git a/docs/code-quality/c6331.md b/docs/code-quality/c6331.md
index 8c3047f9cd..b0e322a1d4 100644
--- a/docs/code-quality/c6331.md
+++ b/docs/code-quality/c6331.md
@@ -1,14 +1,13 @@
---
-description: "Learn more about: Warning C6331"
title: Warning C6331
+description: "Learn more about: Warning C6331"
ms.date: 10/03/2022
f1_keywords: ["C6331", "VirtualFreeInvalidParam1", "__WARNING_VIRTUALFREEINVALIDPARAM1"]
helpviewer_keywords: ["C6331"]
-ms.assetid: cb1ecc2c-29a5-4c57-acf2-0954a4c047b1
---
# Warning C6331
-> Invalid parameter: passing MEM_RELEASE and MEM_DECOMMIT in conjunction to `*function*` is not allowed. This results in the failure of this call
+> Invalid parameter: passing MEM_RELEASE and MEM_DECOMMIT in conjunction to *`function`* is not allowed. This results in the failure of this call
This message indicates that an invalid parameter is passed to `VirtualFree` or `VirtualFreeEx`. `VirtualFree` and `VirtualFreeEx` both reject the flags (`MEM_RELEASE | MEM_DECOMMIT`) in combination. Therefore, the values `MEM_DECOMMIT` and `MEM_RELEASE` may not be used together in the same call.
diff --git a/docs/code-quality/c6335.md b/docs/code-quality/c6335.md
index 738a51f131..a5f62fe5fe 100644
--- a/docs/code-quality/c6335.md
+++ b/docs/code-quality/c6335.md
@@ -1,10 +1,9 @@
---
-description: "Learn more about: Warning C6335"
title: Warning C6335
+description: "Learn more about: Warning C6335"
ms.date: 11/04/2016
f1_keywords: ["C6335", "LEAKING_PROCESS_HANDLE", "__WARNING_LEAKING_PROCESS_HANDLE"]
helpviewer_keywords: ["C6335"]
-ms.assetid: f81c0859-3d82-4182-8bf1-6c3b76c7486f
---
# Warning C6335
@@ -54,7 +53,7 @@ void f( )
}
```
-To correct this warning, call `CloseHandle (pi.``hThread)` to close thread handle as shown in the following code:
+To correct this warning, call `CloseHandle( pi.hThread )` to close thread handle as shown in the following code:
```cpp
#include
diff --git a/docs/code-quality/c6383.md b/docs/code-quality/c6383.md
index 84bf8c2737..72d0ef8b4f 100644
--- a/docs/code-quality/c6383.md
+++ b/docs/code-quality/c6383.md
@@ -1,14 +1,13 @@
---
-description: "Learn more about: Warning C6383"
title: Warning C6383
+description: "Learn more about: Warning C6383"
ms.date: 09/07/2022
f1_keywords: ["C6383", "ELEMENTS_TO_BYTES", "__WARNING_ELEMENTS_TO_BYTES"]
helpviewer_keywords: ["C6383"]
-ms.assetid: f5ff7938-0fbe-4b71-b98f-098fe887799d
---
# Warning C6383
-> Buffer overrun due to conversion of an element count into a byte count: an element count is expected for parameter `*parameter_name*` in call to `*function_name*`
+> Buffer overrun due to conversion of an element count into a byte count: an element count is expected for parameter *`parameter_name`* in call to *`function_name`*
This warning indicates that a non-constant byte count is being passed when an element count is instead required.
diff --git a/docs/code-quality/c6386.md b/docs/code-quality/c6386.md
index 2419833b70..7aa56f9f9f 100644
--- a/docs/code-quality/c6386.md
+++ b/docs/code-quality/c6386.md
@@ -1,10 +1,9 @@
---
description: "Learn more about: Warning C6386"
title: Warning C6386
-ms.date: 11/04/2016
+ms.date: 4/30/2025
f1_keywords: ["C6386", "WRITE_OVERRUN", "__WARNING_WRITE_OVERRUN"]
helpviewer_keywords: ["C6386"]
-ms.assetid: 84e69fe8-8f03-4bb3-b194-e5551882e214
---
# Warning C6386
@@ -23,15 +22,14 @@ The following code generates both this warning and [C6201](../code-quality/c6201
```cpp
#define MAX 25
-void f ( )
+void f()
{
- char ar[MAX];
- // code ...
- ar[MAX] = '\0';
+ char a[MAX];
+ a[MAX] = '\0'; // this writes one element past the end of the buffer
}
```
-To correct both warnings, use the following code:
+To correct the warning, use the following code which accounts for the fact that array indexes are zero-based. Thus `MAX - 1` is the last element in the buffer:
```cpp
#define MAX 25
@@ -39,8 +37,7 @@ To correct both warnings, use the following code:
void f ( )
{
char a[MAX];
- // code ...
- a[MAX - 1] = '\0';
+ a[MAX-1] = '\0';
}
```
diff --git a/docs/code-quality/c6387.md b/docs/code-quality/c6387.md
index d96f377b6d..a925d0b397 100644
--- a/docs/code-quality/c6387.md
+++ b/docs/code-quality/c6387.md
@@ -1,10 +1,9 @@
---
-description: "Learn more about: Warning C6387"
title: Warning C6387
+description: "Learn more about: Warning C6387"
ms.date: 11/04/2016
f1_keywords: ["C6387", "INVALID_PARAM_VALUE_1", "__WARNING_INVALID_PARAM_VALUE_1"]
helpviewer_keywords: ["C6387"]
-ms.assetid: 3ea2fc4d-ffc3-4c3c-bfae-d42aa56235d8
---
# Warning C6387
@@ -27,7 +26,7 @@ _Post_ _Null_ char * g();
void f(_In_ char *pch);
-void main()
+int main()
{
char *pCh = g();
f(pCh); // Warning C6387
@@ -43,7 +42,7 @@ _Post_ _Notnull_ char * g();
void f(_In_ char *pch);
-void main()
+int main()
{
char *pCh = g();
f(pCh);
diff --git a/docs/code-quality/c6393.md b/docs/code-quality/c6393.md
index 07f0c540f0..a905c012a2 100644
--- a/docs/code-quality/c6393.md
+++ b/docs/code-quality/c6393.md
@@ -1,6 +1,6 @@
---
-description: "Learn more about: Warning C6393"
title: Warning C6393
+description: "Learn more about: Warning C6393"
ms.date: 11/29/2023
f1_keywords: ["C6393", "LEAP_YEAR_INVALID_DATE_KEYED_LOOKUP", "__WARNING_LEAP_YEAR_INVALID_DATE_KEYED_LOOKUP"]
helpviewer_keywords: ["C6393"]
@@ -26,26 +26,25 @@ Code analysis name: `LEAP_YEAR_INVALID_DATE_KEYED_LOOKUP`
The following code creates a lookup table for the day of the year, assuming 365 days per year. However, this doesn't work if the year is a leap year:
```cpp
-
-#include
-
-void foo(int year)
-{
- const std::vector items(365); // C6393
- // Initialize items and use it...
+#include
+
+void foo(int year)
+{
+ const std::vector items(365); // C6393
+ // Initialize items and use it...
}
```
To fix the problem, adjust the size of the lookup table as the table is created according to the result of appropriate leap year check:
```cpp
-#include
-
-void foo(int year)
-{
- bool isLeapYear = year % 4 == 0 && (year % 100 != 0 || year % 400 == 0);
- const std::vector items(isLeapYear ? 366 : 365);
- // Initialize items and use it...
+#include
+
+void foo(int year)
+{
+ bool isLeapYear = year % 4 == 0 && (year % 100 != 0 || year % 400 == 0);
+ const std::vector items(isLeapYear ? 366 : 365);
+ // Initialize items and use it...
}
```
diff --git a/docs/code-quality/c6394.md b/docs/code-quality/c6394.md
index 7d5c7b4db2..d4a4fe6668 100644
--- a/docs/code-quality/c6394.md
+++ b/docs/code-quality/c6394.md
@@ -1,6 +1,6 @@
---
-description: "Learn more about: Warning C6394"
title: Warning C6394
+description: "Learn more about: Warning C6394"
ms.date: 11/29/2023
f1_keywords: ["C6394", "LEAP_YEAR_INVALID_DATE_KEYED_LOOKUP_MUTABLE", "__WARNING_LEAP_YEAR_INVALID_DATE_KEYED_LOOKUP_MUTABLE"]
helpviewer_keywords: ["C6394"]
@@ -52,7 +52,7 @@ void foo(int year)
## Heuristics
-This rule is enforced by checking if a lookup table has an initial size of 365 elements, but can be expanded to 366. However, it doesn't check if the table’s size is adjusted through proper leap year check or not, and so is a low confidence warning.
+This rule is enforced by checking if a lookup table has an initial size of 365 elements, but can be expanded to 366. However, it doesn't check if the table's size is adjusted through proper leap year check or not, and so is a low confidence warning.
## See also
diff --git a/docs/code-quality/c6411.md b/docs/code-quality/c6411.md
index a24d5c9118..a4a99565a8 100644
--- a/docs/code-quality/c6411.md
+++ b/docs/code-quality/c6411.md
@@ -1,9 +1,9 @@
---
-description: "Learn more about: Warning C6411"
title: Warning C6411
+description: "Learn more about: Warning C6411"
ms.date: 11/04/2016
f1_keywords: ["C6411", "POTENTIAL_READ_OVERRUN"]
-ms.assetid: 6bbc1734-eec4-4ad6-9908-4ed2a5f025db
+helpviewer_keywords: ["C6411"]
---
# Warning C6411
diff --git a/docs/code-quality/c6412.md b/docs/code-quality/c6412.md
index 5c29356882..230011ec6e 100644
--- a/docs/code-quality/c6412.md
+++ b/docs/code-quality/c6412.md
@@ -1,9 +1,9 @@
---
-description: "Learn more about: Warning C6412"
title: Warning C6412
+description: "Learn more about: Warning C6412"
ms.date: 11/04/2016
f1_keywords: ["C6412", "POTENTIAL_WRITE_OVERRUN"]
-ms.assetid: 6498f045-1bdc-4428-9d95-d9498de207bb
+helpviewer_keywords: ["C6412"]
---
# Warning C6412
diff --git a/docs/code-quality/c6506.md b/docs/code-quality/c6506.md
index df143e3c84..377aef7813 100644
--- a/docs/code-quality/c6506.md
+++ b/docs/code-quality/c6506.md
@@ -1,10 +1,9 @@
---
-description: "Learn more about: Warning C6506"
title: Warning C6506
+description: "Learn more about: Warning C6506"
ms.date: 11/04/2016
f1_keywords: ["C6506", "BUFFER_SIZE_ON_NON_POINTER_OR_ARRAY", "__WARNING_BUFFER_SIZE_ON_NON_POINTER_OR_ARRAY"]
helpviewer_keywords: ["C6506"]
-ms.assetid: 20b87ee8-13ea-4d71-95a1-2b2d144d196a
---
# Warning C6506
@@ -21,7 +20,7 @@ Code analysis name: `BUFFER_SIZE_ON_NON_POINTER_OR_ARRAY`
The following code generates this warning:
```cpp
-#include
+#include
void f(_Out_ char c)
{
c = 'd';
@@ -31,7 +30,7 @@ void f(_Out_ char c)
To correct this warning, use a pointer or an array type, as shown in the following sample code:
```cpp
-#include
+#include
void f(_Out_ char *c)
{
*c = 'd';
diff --git a/docs/code-quality/c6701.md b/docs/code-quality/c6701.md
index bdbbdf6afa..386d29a099 100644
--- a/docs/code-quality/c6701.md
+++ b/docs/code-quality/c6701.md
@@ -1,10 +1,9 @@
---
-description: "Learn more about: Warning C6701"
title: Warning C6701
+description: "Learn more about: Warning C6701"
ms.date: 11/04/2016
f1_keywords: ["C6701"]
-helpviewer_keywords: ["C67901"]
-ms.assetid: c48484e2-542c-4f7b-93ea-98c6367cb3d9
+helpviewer_keywords: ["C6701"]
---
# Warning C6701
diff --git a/docs/code-quality/c6993.md b/docs/code-quality/c6993.md
index e4df96bfab..54f78c56c9 100644
--- a/docs/code-quality/c6993.md
+++ b/docs/code-quality/c6993.md
@@ -1,12 +1,14 @@
---
-description: "Learn more about: Warning C6993"
title: Warning C6993
-ms.date: 11/04/2016
+description: "Learn more about: Warning C6993"
+ms.date: 2/25/2025
f1_keywords: ["C6993"]
-ms.assetid: 7ea93bc6-b934-4b6b-b71a-a56e765fb4cd
+helpviewer_keywords: ["C6993"]
---
# Warning C6993
> Code analysis ignores OpenMP constructs; analyzing single-threaded code
-This warning indicates that the Code Analyzer has encountered Open MP pragmas that it can't analyze.
+This warning indicates that the static analysis tools don't support Open MP pragmas. The static analysis tools could generate incorrect results because they assume the code is single-threaded, not multi-threaded.
+
+Your code doesn't necessarily need to be 'fixed' to resolve this diagnostic because this warning indicates what the toolset supports and not an issue with your code.
\ No newline at end of file
diff --git a/docs/code-quality/c6995.md b/docs/code-quality/c6995.md
index 6e5736bd79..4ca022014e 100644
--- a/docs/code-quality/c6995.md
+++ b/docs/code-quality/c6995.md
@@ -1,9 +1,9 @@
---
-description: "Learn more about: Warning C6995"
title: Warning C6995
+description: "Learn more about: Warning C6995"
ms.date: 11/04/2016
f1_keywords: ["C6995"]
-ms.assetid: 1e82e3ad-99fe-4a35-87d5-359c74b9658e
+helpviewer_keywords: ["C6995"]
---
# Warning C6995
diff --git a/docs/code-quality/c6997.md b/docs/code-quality/c6997.md
index 4090bea051..8cbfc9bd5e 100644
--- a/docs/code-quality/c6997.md
+++ b/docs/code-quality/c6997.md
@@ -1,9 +1,9 @@
---
-description: "Learn more about: Warning C6997"
title: Warning C6997
+description: "Learn more about: Warning C6997"
ms.date: 11/04/2016
f1_keywords: ["C6997", "IGNORED_ANNOTATIONS"]
-ms.assetid: 48fd86a3-d57b-4ecb-979a-5d3a4186482e
+helpviewer_keywords: ["C6997"]
---
# Warning C6997
diff --git a/docs/code-quality/index.yml b/docs/code-quality/index.yml
index 7ae4caa668..337b3f5afa 100644
--- a/docs/code-quality/index.yml
+++ b/docs/code-quality/index.yml
@@ -8,6 +8,7 @@ metadata:
description: Learn how Visual Studio can help you analyze C and C++ code quality.
ms.topic: landing-page
ms.date: 05/26/2020
+ ms.author: twhitney
ms.custom: intro-landing-hub
# linkListType: architecture | concept | deploy | download | get-started | how-to-guide | learn | overview | quickstart | reference | tutorial | video | whats-new
diff --git a/docs/code-quality/quick-start-code-analysis-for-c-cpp.md b/docs/code-quality/quick-start-code-analysis-for-c-cpp.md
index b54c5ce1d3..499af5c14a 100644
--- a/docs/code-quality/quick-start-code-analysis-for-c-cpp.md
+++ b/docs/code-quality/quick-start-code-analysis-for-c-cpp.md
@@ -19,7 +19,7 @@ You can improve the quality of your application by running code analysis regular
1. To run code analysis every time the project is built using the selected configuration, select the **Enable Code Analysis on Build** check box. You can also run code analysis manually by opening the **Analyze** menu and then choosing **Run Code Analysis on** *ProjectName* or **Run Code Analysis on File**.
-1. Choose the [rule set](using-rule-sets-to-specify-the-cpp-rules-to-run.md) that you want to use or create a [custom rule set](using-rule-sets-to-specify-the-cpp-rules-to-run.md#to-create-a-rule-set-in-a-text-editor). If using LLVM/clang-cl, see [Using Clang-Tidy in Visual Studio](../code-quality/clang-tidy.md) to configure Clang-Tidy analysis options.
+1. Choose the [rule set](using-rule-sets-to-specify-the-cpp-rules-to-run.md) that you want to use or create a [custom rule set](using-rule-sets-to-specify-the-cpp-rules-to-run.md#to-create-a-rule-set-in-a-text-editor). If using LLVM/clang-cl, see [Using Clang-Tidy in Visual Studio](clang-tidy.md) to configure Clang-Tidy analysis options.
### Standard C/C++ rule sets
@@ -100,7 +100,7 @@ The Error List window lists the code analysis warnings found. The results are di
For detailed information about the warning, including possible solutions to the issue, choose the warning ID in the Code column to display its corresponding online help article.
-Double-click a warning to move the cursor to the line of code that caused the warning in the Visual Studio code editor. Or, press Enter on the selected warning.
+Double-click a warning to move the cursor to the line of code that caused the warning in the code editor. Or, press Enter on the selected warning.
After you understand the problem, you can resolve it in your code. Then, rerun code analysis to make sure that the warning no longer appears in the Error List.
@@ -128,4 +128,4 @@ You can search long lists of warning messages and you can filter warnings in mul
## See also
-- [Code analysis for C/C++](../code-quality/code-analysis-for-c-cpp-overview.md)
+- [Code analysis for C/C++](code-analysis-for-c-cpp-overview.md)
diff --git a/docs/code-quality/toc.yml b/docs/code-quality/toc.yml
index 049d6ad622..61bafc57ca 100644
--- a/docs/code-quality/toc.yml
+++ b/docs/code-quality/toc.yml
@@ -591,6 +591,10 @@ items:
href: ../code-quality/c26117.md
- name: Warning C26130
href: ../code-quality/c26130.md
+ - name: Warning C26132
+ href: c26132.md
+ - name: Warning C26133
+ href: c26133.md
- name: Warning C26135
href: ../code-quality/c26135.md
- name: Warning C26138
@@ -633,6 +637,10 @@ items:
href: ../code-quality/c26830.md
- name: Warning C26831
href: ../code-quality/c26831.md
+ - name: Warning C26838
+ href: ../code-quality/c26838.md
+ - name: Warning C26839
+ href: ../code-quality/c26839.md
- name: Warning C26832
href: ../code-quality/c26832.md
- name: Warning C26833
diff --git a/docs/code-quality/understanding-sal.md b/docs/code-quality/understanding-sal.md
index 8669d1689b..7e3c30bfd4 100644
--- a/docs/code-quality/understanding-sal.md
+++ b/docs/code-quality/understanding-sal.md
@@ -1,9 +1,8 @@
---
-description: "Learn more about: Understanding SAL"
title: Understanding SAL
+description: "Learn more about: Understanding SAL"
ms.date: 11/04/2016
ms.topic: "conceptual"
-ms.assetid: a94d6907-55f2-4874-9571-51d52d6edcfd
---
# Understanding SAL
@@ -94,9 +93,9 @@ These annotations help identify possible uninitialized values and invalid null p
This section shows code examples for the basic SAL annotations.
-### Using the Visual Studio Code Analysis Tool to Find Defects
+### Using the Visual Studio code analysis tool to find defects
-In the examples, the Visual Studio Code Analysis tool is used together with SAL annotations to find code defects. Here's how to do that.
+In the examples, the Visual Studio code analysis tool is used together with SAL annotations to find code defects. Here's how to do that.
#### To use Visual Studio code analysis tools and SAL
@@ -145,7 +144,7 @@ void BadInCaller()
}
```
-If you use Visual Studio Code Analysis on this example, it validates that the callers pass a non-Null pointer to an initialized buffer for `pInt`. In this case, `pInt` pointer cannot be NULL.
+If you use Visual Studio code analysis on this example, it validates that the callers pass a non-Null pointer to an initialized buffer for `pInt`. In this case, `pInt` pointer cannot be NULL.
### Example: The \_In\_opt\_ Annotation
@@ -172,7 +171,7 @@ void InOptCaller()
}
```
-Visual Studio Code Analysis validates that the function checks for NULL before it accesses the buffer.
+Visual Studio code analysis validates that the function checks for NULL before it accesses the buffer.
### Example: The \_Out\_ Annotation
@@ -198,7 +197,7 @@ void OutCaller()
}
```
-Visual Studio Code Analysis Tool validates that the caller passes a non-NULL pointer to a buffer for `pInt` and that the buffer is initialized by the function before it returns.
+Visual Studio code analysis validates that the caller passes a non-NULL pointer to a buffer for `pInt` and that the buffer is initialized by the function before it returns.
### Example: The \_Out\_opt\_ Annotation
@@ -225,7 +224,7 @@ void OutOptCaller()
}
```
-Visual Studio Code Analysis validates that this function checks for NULL before `pInt` is dereferenced, and if `pInt` is not NULL, that the buffer is initialized by the function before it returns.
+Visual Studio code analysis validates that this function checks for NULL before `pInt` is dereferenced, and if `pInt` is not NULL, that the buffer is initialized by the function before it returns.
### Example: The \_Inout\_ Annotation
@@ -256,7 +255,7 @@ void BadInOutCaller()
}
```
-Visual Studio Code Analysis validates that callers pass a non-NULL pointer to an initialized buffer for `pInt`, and that, before return, `pInt` is still non-NULL and the buffer is initialized.
+Visual Studio code analysis validates that callers pass a non-NULL pointer to an initialized buffer for `pInt`, and that, before return, `pInt` is still non-NULL and the buffer is initialized.
### Example: The \_Inout\_opt\_ Annotation
@@ -285,7 +284,7 @@ void InOutOptCaller()
}
```
-Visual Studio Code Analysis validates that this function checks for NULL before it accesses the buffer, and if `pInt` is not NULL, that the buffer is initialized by the function before it returns.
+Visual Studio code analysis validates that this function checks for NULL before it accesses the buffer, and if `pInt` is not NULL, that the buffer is initialized by the function before it returns.
### Example: The \_Outptr\_ Annotation
@@ -315,7 +314,7 @@ void OutPtrCaller()
}
```
-Visual Studio Code Analysis validates that the caller passes a non-NULL pointer for `*pInt`, and that the buffer is initialized by the function before it returns.
+Visual Studio code analysis validates that the caller passes a non-NULL pointer for `*pInt`, and that the buffer is initialized by the function before it returns.
### Example: The \_Outptr\_opt\_ Annotation
@@ -347,7 +346,7 @@ void OutPtrOptCaller()
}
```
-Visual Studio Code Analysis validates that this function checks for NULL before `*pInt` is dereferenced, and that the buffer is initialized by the function before it returns.
+Visual Studio code analysis validates that this function checks for NULL before `*pInt` is dereferenced, and that the buffer is initialized by the function before it returns.
### Example: The \_Success\_ Annotation in Combination with \_Out\_
@@ -366,7 +365,7 @@ bool GetValue(_Out_ int *pInt, bool flag)
}
```
-The `_Out_` annotation causes Visual Studio Code Analysis to validate that the caller passes a non-NULL pointer to a buffer for `pInt`, and that the buffer is initialized by the function before it returns.
+The `_Out_` annotation causes Visual Studio code analysis to validate that the caller passes a non-NULL pointer to a buffer for `pInt`, and that the buffer is initialized by the function before it returns.
## SAL Best Practice
@@ -384,7 +383,7 @@ Here are some guidelines:
- Annotate value-range annotations so that Code Analysis can ensure buffer and pointer safety.
-- Annotate locking rules and locking side effects. For more information, see [Annotating Locking Behavior](../code-quality/annotating-locking-behavior.md).
+- Annotate locking rules and locking side effects. For more information, see [Annotating Locking Behavior](annotating-locking-behavior.md).
- Annotate driver properties and other domain-specific properties.
@@ -392,10 +391,10 @@ Or you can annotate all parameters to make your intent clear throughout and to m
## See also
-- [Using SAL Annotations to Reduce C/C++ Code Defects](../code-quality/using-sal-annotations-to-reduce-c-cpp-code-defects.md)
-- [Annotating Function Parameters and Return Values](../code-quality/annotating-function-parameters-and-return-values.md)
-- [Annotating Function Behavior](../code-quality/annotating-function-behavior.md)
-- [Annotating Structs and Classes](../code-quality/annotating-structs-and-classes.md)
-- [Annotating Locking Behavior](../code-quality/annotating-locking-behavior.md)
-- [Specifying When and Where an Annotation Applies](../code-quality/specifying-when-and-where-an-annotation-applies.md)
-- [Best Practices and Examples](../code-quality/best-practices-and-examples-sal.md)
+- [Using SAL Annotations to Reduce C/C++ Code Defects](using-sal-annotations-to-reduce-c-cpp-code-defects.md)
+- [Annotating Function Parameters and Return Values](annotating-function-parameters-and-return-values.md)
+- [Annotating Function Behavior](annotating-function-behavior.md)
+- [Annotating Structs and Classes](annotating-structs-and-classes.md)
+- [Annotating Locking Behavior](annotating-locking-behavior.md)
+- [Specifying When and Where an Annotation Applies](specifying-when-and-where-an-annotation-applies.md)
+- [Best Practices and Examples](best-practices-and-examples-sal.md)
diff --git a/docs/code-quality/using-the-cpp-core-guidelines-checkers.md b/docs/code-quality/using-the-cpp-core-guidelines-checkers.md
index 3609f413ac..8ffa7df200 100644
--- a/docs/code-quality/using-the-cpp-core-guidelines-checkers.md
+++ b/docs/code-quality/using-the-cpp-core-guidelines-checkers.md
@@ -74,7 +74,7 @@ int main()
int arr[10]; // warning C26494
int* p = arr; // warning C26485
- [[gsl::suppress(bounds.1)]] // This attribute suppresses Bounds rule #1
+ [[gsl::suppress("bounds.1", justification : "This attribute suppresses Bounds rules #1")]]
{
int* q = p + 1; // warning C26481 (suppressed)
p = q++; // warning C26481 (suppressed)
@@ -104,7 +104,7 @@ c:\users\username\documents\visual studio 2015\projects\corecheckexample\coreche
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
```
-The C++ Core Guidelines are there to help you write better and safer code. However, you might find an instance where a rule or a profile shouldn't be applied. It's easy to suppress it directly in the code. You can use the `[[gsl::suppress]]` attribute to keep C++ Core Check from detecting and reporting any violation of a rule in the following code block. You can mark individual statements to suppress specific rules. You can even suppress the entire bounds profile by writing `[[gsl::suppress(bounds)]]` without including a specific rule number.
+The C++ Core Guidelines are there to help you write better and safer code. However, you might find an instance where a rule or a profile shouldn't be applied. It's easy to suppress it directly in the code. You can use the `[[gsl::suppress]]` attribute to keep C++ Core Check from detecting and reporting any violation of a rule in the following code block. You can mark individual statements to suppress specific rules. You can even suppress the entire bounds profile by writing `[[gsl::suppress("bounds")]]` without including a specific rule number.
## Supported rule sets
@@ -197,10 +197,10 @@ The Microsoft C++ compiler has limited support for the `[[gsl::suppress]]` attri
```cpp
// Suppress only warnings from the 'r.11' rule in expression.
-[[gsl::suppress(r.11)]] new int;
+[[gsl::suppress("r.11")]] new int;
// Suppress all warnings from the 'r' rule group (resource management) in block.
-[[gsl::suppress(r)]]
+[[gsl::suppress("r")]]
{
new int;
}
@@ -209,7 +209,7 @@ The Microsoft C++ compiler has limited support for the `[[gsl::suppress]]` attri
// For declarations, you might need to use the surrounding block.
// Macros are not expanded inside of attributes.
// Use plain numbers instead of macros from the warnings.h.
-[[gsl::suppress(26400)]]
+[[gsl::suppress("26400")]]
{
int *p = new int;
}
@@ -317,11 +317,11 @@ Because of the way the code analysis rules get loaded within Visual Studio 2015,
1. In the **NuGet Package Manager** window, search for Microsoft.CppCoreCheck.
- 
+ 
1. Select the Microsoft.CppCoreCheck package and then choose the **Install** button to add the rules to your project.
- The NuGet package adds an MSBuild *`.targets`* file to your project that is invoked when you enable code analysis on your project. The *`.targets`* file adds the C++ Core Check rules as another extension to the Visual Studio Code analysis tool. When the package is installed, you can use the Property Pages dialog to enable or disable the released and experimental rules.
+ The NuGet package adds an MSBuild *`.targets`* file to your project that is invoked when you enable code analysis on your project. The *`.targets`* file adds the C++ Core Check rules as another extension to the Visual Studio code analysis tool. When the package is installed, you can use the Property Pages dialog to enable or disable the released and experimental rules.
::: moniker-end
diff --git a/docs/cpp/arrays-cpp.md b/docs/cpp/arrays-cpp.md
index e32eaab9fa..48563141ee 100644
--- a/docs/cpp/arrays-cpp.md
+++ b/docs/cpp/arrays-cpp.md
@@ -161,10 +161,9 @@ int i2[5][7];
It specifies an array of type **`int`**, conceptually arranged in a two-dimensional matrix of five rows and seven columns, as shown in the following figure:
-:::image type="content" source="../cpp/media/vc38rc1.gif" alt-text="Conceptual layout of a multidimensional array.":::
-
+:::image type="complex" source="../cpp/media/vc38rc1.gif" alt-text="Conceptual layout of a multidimensional array.":::
The image is a grid 7 cells wide and 5 cells high. Each cell contains the index of the cell. The first cell index is labeled 0,0. The next cell in that row is 0,1 and so on to the last cell in that row which is 0,6. The next row starts with the index 1,0. The cell after that has an index of 1,1. The last cell in that row is 1,6. This pattern repeats until the last row, which starts with the index 4,0. The last cell in the last row has an index of 4,6.
-:::image-end
+:::image-end:::
You can declare multidimensioned arrays that have an initializer list (as described in [Initializers](../cpp/initializers.md)). In these declarations, the constant expression that specifies the bounds for the first dimension can be omitted. For example:
diff --git a/docs/cpp/attributes.md b/docs/cpp/attributes.md
index 5c3644f81c..b34a559f80 100644
--- a/docs/cpp/attributes.md
+++ b/docs/cpp/attributes.md
@@ -77,16 +77,18 @@ The `[[noreturn]]` attribute specifies that a function never returns; in other w
## Microsoft-specific attributes
-### `[[gsl::suppress(rules)]]`
+### `[[gsl::suppress( [, justification: ])]]`
-The Microsoft-specific `[[gsl::suppress(rules)]]` attribute is used to suppress warnings from checkers that enforce [Guidelines Support Library (GSL)](https://github.com/Microsoft/GSL) rules in code. For example, consider this code snippet:
+`` is a string that specifies the name of the rule to suppress. The optional `justification` field allows you to explain why a warning is being disabled or suppressed. This value will appear in the SARIF output when the `/analyze:log:includesuppressed` option is specified. Its value is a UTF-8 encoded narrow string literal. The `[[gsl::suppress]]` attribute is available in Visual Studio 2022 version 17.14 and later versions.
+
+The Microsoft-specific `[[gsl::suppress]]` attribute is used to suppress warnings from checkers that enforce [Guidelines Support Library (GSL)](https://github.com/Microsoft/GSL) rules in code. For example, consider this code snippet:
```cpp
int main()
{
int arr[10]; // GSL warning C26494 will be fired
int* p = arr; // GSL warning C26485 will be fired
- [[gsl::suppress(bounds.1)]] // This attribute suppresses Bounds rule #1
+ [[gsl::suppress("bounds.1", justification: "This attribute suppresses Bounds rule #1")]]
{
int* q = p + 1; // GSL warning C26481 suppressed
p = q--; // GSL warning C26481 suppressed
@@ -102,7 +104,7 @@ The example raises these warnings:
- [C26481](../code-quality/c26481.md) (Bounds Rule 1: Don't use pointer arithmetic. Use span instead.)
-The first two warnings fire when you compile this code with the CppCoreCheck code analysis tool installed and activated. But the third warning doesn't fire because of the attribute. You can suppress the entire bounds profile by writing `[[gsl::suppress(bounds)]]` without including a specific rule number. The C++ Core Guidelines are designed to help you write better and safer code. The suppress attribute makes it easy to turn off the warnings when they aren't wanted.
+The first two warnings fire when you compile this code with the CppCoreCheck code analysis tool installed and activated. But the third warning doesn't fire because of the attribute. You can suppress the entire bounds profile by writing `[[gsl::suppress("bounds")]]` without including a specific rule number. The C++ Core Guidelines are designed to help you write better and safer code. The suppress attribute makes it easy to turn off the warnings when they aren't wanted.
### `[[msvc::flatten]]`
@@ -159,7 +161,7 @@ void f() {
### `[[msvc::noinline]]`
-When placed before a function declaration, the Microsoft-specific attribute `[[msvc::noinline]]` has the same meaning as `declspec(noinline)`.
+When placed before a function declaration, the Microsoft-specific attribute `[[msvc::noinline]]` has the same meaning as `__declspec(noinline)`.
### `[[msvc::noinline_calls]]`
diff --git a/docs/cpp/bstr-t-assign.md b/docs/cpp/bstr-t-assign.md
index 565b248630..801be55d0a 100644
--- a/docs/cpp/bstr-t-assign.md
+++ b/docs/cpp/bstr-t-assign.md
@@ -1,11 +1,11 @@
---
-description: "Learn more about: _bstr_t::Assign"
title: "_bstr_t::Assign"
+description: "Learn more about: _bstr_t::Assign"
ms.date: 02/02/2021
f1_keywords: ["_bstr_t::Assign"]
helpviewer_keywords: ["Assign method [C++]"]
---
-# _`bstr_t::Assign`
+# `_bstr_t::Assign`
**Microsoft Specific**
diff --git a/docs/cpp/c-cpp-language-and-standard-libraries.md b/docs/cpp/c-cpp-language-and-standard-libraries.md
index a6f866c446..59218ff5e3 100644
--- a/docs/cpp/c-cpp-language-and-standard-libraries.md
+++ b/docs/cpp/c-cpp-language-and-standard-libraries.md
@@ -1,8 +1,7 @@
---
-description: "Learn more about: C/C++ language and standard libraries reference"
title: "C/C++ language and standard libraries reference"
-ms.date: "08/13/2019"
-ms.assetid: c26a6682-961a-43ef-ad33-2adc612f69ac
+description: "Learn more about: C/C++ language and standard libraries reference"
+ms.date: 09/11/2024
ms.topic: "overview"
ms.custom: intro-overview
---
@@ -17,7 +16,7 @@ You'll also find documentation for the C runtime library, the C++ standard libra
[C language](../c-language/c-language-reference.md)\
Reference content for the Microsoft implementation of the C language.
-[C++ language](../cpp/cpp-language-reference.md)\
+[C++ language](cpp-language-reference.md)\
Reference content for the Microsoft implementation of the C++ language.
[C/C++ preprocessor](../preprocessor/c-cpp-preprocessor-reference.md)\
@@ -61,10 +60,13 @@ Classes that simplify the writing of programs that use data parallelism or task
[OpenMP](../parallel/openmp/openmp-in-visual-cpp.md)\
Reference for the Microsoft implementation of the OpenMP API.
+[Proxy library](https://github.com/microsoft/proxy)\
+A header-only C++20 library for using polymorphism in C++ without inheritance. For API reference information, see [Proxy 3 Specifications](https://microsoft.github.io/proxy/docs/specifications.html)
+
[SafeInt library](../safeint/safeint-library.md)\
A portable library that can be used with MSVC, GCC, or Clang to help prevent integer overflows.
-[Data Access Libraries](../data/data-access-in-cpp.md)
+[Data Access Libraries](../data/data-access-in-cpp.md)\
Libraries to support data access using ATL or MFC, and legacy services such as OLE DB and ODBC.
## Related articles
diff --git a/docs/cpp/casting.md b/docs/cpp/casting.md
index 17830ed970..1a74c49398 100644
--- a/docs/cpp/casting.md
+++ b/docs/cpp/casting.md
@@ -1,6 +1,6 @@
---
-description: "Learn more about: Casting in C++"
title: "Casting"
+description: "Learn more about: Casting in C++"
ms.date: 6/11/2024
helpviewer_keywords: ["casting [C++]", "coercion [C++]", "virtual functions [C++], in derived classes [C++]", "static cast operator", "dynamic cast operator", "polymorphic classes [C++]", "classes [C++], polymorphism"]
ai-usage: ai-assisted
@@ -9,21 +9,21 @@ ai-usage: ai-assisted
In C++, if a class is derived from a base class containing one or more virtual functions, a pointer to that base class type can be used to call virtual functions in the derived class object. A class containing virtual functions is sometimes called a "polymorphic class."
-
+\
Class hierarchy
An object of type `C` can be visualized as follows:
-
+\
Class C with subobjects B and A
Given an instance of class `C`, there's a `B` subobject and an `A` subobject. The instance of `C`, including the `A` and `B` subobjects, is the "complete object."
Because a derived class completely contains the definitions of all the base classes from which it's derived, it's safe to cast a pointer to any of its base classes (also called an upcast). Given a pointer to a base class, it may be safe to cast the pointer to an instance of a derived class (also called a downcast).
-Using run-time type information, it's possible to check whether a pointer actually points to a complete object and can be safely cast to point to another object in its hierarchy. The [dynamic_cast](../cpp/dynamic-cast-operator.md) operator performs a run-time check to ensure that the operation is safe. It's better to design your class hierarchy so that you can use virtual functions to avoid the need for downcasting. However, if you must downcast, use `dynamic_cast` to ensure that the operation is safe.
+Using run-time type information, it's possible to check whether a pointer actually points to a complete object and can be safely cast to point to another object in its hierarchy. The [dynamic_cast](dynamic-cast-operator.md) operator performs a run-time check to ensure that the operation is safe. It's better to design your class hierarchy so that you can use virtual functions to avoid the need for downcasting. However, if you must downcast, use `dynamic_cast` to ensure that the operation is safe.
-For conversion of nonpolymorphic types, you can use the [static_cast](../cpp/static-cast-operator.md) operator (this topic explains the difference between static and dynamic casting conversions, and when it's appropriate to use each).
+For conversion of nonpolymorphic types, you can use the [static_cast](static-cast-operator.md) operator (this topic explains the difference between static and dynamic casting conversions, and when it's appropriate to use each).
The following example demonstrates the use of `dynamic_cast` and `static_cast`:
@@ -72,9 +72,9 @@ int main() {
This section covers the following topics:
-- [Casting operators](../cpp/casting-operators.md)\
-- [Run-time type information](../cpp/run-time-type-information.md)
+- [Casting operators](casting-operators.md)
+- [Run-time type information](run-time-type-information.md)
## See also
-[Expressions](../cpp/expressions-cpp.md)
+[Expressions](expressions-cpp.md)
diff --git a/docs/cpp/class-member-overview.md b/docs/cpp/class-member-overview.md
index 54f6191224..3d97b74bea 100644
--- a/docs/cpp/class-member-overview.md
+++ b/docs/cpp/class-member-overview.md
@@ -17,7 +17,7 @@ The full list of member categories is as follows:
- [Overview of member functions](overview-of-member-functions.md).
-- [Mutable](static-members-cpp.md) and [static](static-members-cpp.md) data members, including built-in types and other user defined types.
+- [Mutable](mutable-data-members-cpp.md) and [static](static-members-cpp.md) data members, including built-in types and other user defined types.
- Operators
diff --git a/docs/cpp/clrcall.md b/docs/cpp/clrcall.md
index e0271e971a..c368132c78 100644
--- a/docs/cpp/clrcall.md
+++ b/docs/cpp/clrcall.md
@@ -38,7 +38,7 @@ int __clrcall Func1() {
}
// Func1 hasn't been used at this point (code has not been generated),
-// so runtime returns the adddress of a stub to the function
+// so runtime returns the address of a stub to the function
int (__clrcall *pf)() = &Func1;
// code calls the function, code generated at difference address
diff --git a/docs/cpp/codesnippet/CPP/how-to-create-and-use-shared-ptr-instances_1.cpp b/docs/cpp/codesnippet/CPP/how-to-create-and-use-shared-ptr-instances_1.cpp
index af736b0495..753367555e 100644
--- a/docs/cpp/codesnippet/CPP/how-to-create-and-use-shared-ptr-instances_1.cpp
+++ b/docs/cpp/codesnippet/CPP/how-to-create-and-use-shared-ptr-instances_1.cpp
@@ -1,4 +1,3 @@
-
// Use make_shared function when possible.
auto sp1 = make_shared(L"The Beatles", L"Im Happy Just to Dance With You");
diff --git a/docs/cpp/codesnippet/CPP/how-to-create-and-use-shared-ptr-instances_6.cpp b/docs/cpp/codesnippet/CPP/how-to-create-and-use-shared-ptr-instances_6.cpp
index 551c3f2f5b..2c02d593fb 100644
--- a/docs/cpp/codesnippet/CPP/how-to-create-and-use-shared-ptr-instances_6.cpp
+++ b/docs/cpp/codesnippet/CPP/how-to-create-and-use-shared-ptr-instances_6.cpp
@@ -1,4 +1,3 @@
-
// Initialize two separate raw pointers.
// Note that they contain the same values.
auto song1 = new Song(L"Village People", L"YMCA");
diff --git a/docs/cpp/codesnippet/CPP/how-to-create-and-use-unique-ptr-instances_3.cpp b/docs/cpp/codesnippet/CPP/how-to-create-and-use-unique-ptr-instances_3.cpp
index e7ad81c8d5..29baefa191 100644
--- a/docs/cpp/codesnippet/CPP/how-to-create-and-use-unique-ptr-instances_3.cpp
+++ b/docs/cpp/codesnippet/CPP/how-to-create-and-use-unique-ptr-instances_3.cpp
@@ -1,4 +1,3 @@
-
class MyClass
{
private:
diff --git a/docs/cpp/codesnippet/CPP/smart-pointers-modern-cpp_2.cpp b/docs/cpp/codesnippet/CPP/smart-pointers-modern-cpp_2.cpp
index 10ac9aab95..2c7e2716ed 100644
--- a/docs/cpp/codesnippet/CPP/smart-pointers-modern-cpp_2.cpp
+++ b/docs/cpp/codesnippet/CPP/smart-pointers-modern-cpp_2.cpp
@@ -1,4 +1,3 @@
-
class LargeObject
{
public:
diff --git a/docs/cpp/com-ptr-t-extractors.md b/docs/cpp/com-ptr-t-extractors.md
index 416c396712..305a593e87 100644
--- a/docs/cpp/com-ptr-t-extractors.md
+++ b/docs/cpp/com-ptr-t-extractors.md
@@ -4,7 +4,6 @@ description: "Describes the extraction operators for the _com_ptr_t class."
ms.date: 07/07/2020
f1_keywords: ["_com_ptr_t::operatorInterface&", "_com_ptr_t::operatorbool", "_com_ptr_t::operator->", "_com_ptr_t::operator*"]
helpviewer_keywords: ["operator Interface& [C++]", "* operator [C++], with specific objects", "operator& [C++]", "operator* [C++]", "-> operator [C++], with specific objects", "& operator [C++], with specific objects", "operator Interface* [C++]", "operator * [C++]", "operator->", "operator bool", "extractors, _com_ptr_t class", "extractors [C++]"]
-ms.assetid: 194b9e0e-123c-49ff-a187-0a7fcd68145a
---
# `_com_ptr_t` Extractors
@@ -14,7 +13,7 @@ Extract the encapsulated COM interface pointer.
## Syntax
-```c++
+```cpp
operator Interface*( ) const throw( );
operator Interface&( ) const;
Interface& operator*( ) const;
diff --git a/docs/cpp/compiler-limits.md b/docs/cpp/compiler-limits.md
index c1926cd274..4fcdd08cfc 100644
--- a/docs/cpp/compiler-limits.md
+++ b/docs/cpp/compiler-limits.md
@@ -1,6 +1,6 @@
---
-description: "Learn more about: Compiler Limits"
title: "Compiler Limits"
+description: "Learn more about: Compiler Limits"
ms.date: "06/05/2023"
helpviewer_keywords: ["cl.exe compiler, limits for language constructs"]
---
@@ -22,7 +22,7 @@ The C++ standard recommends limits for various language constructs. The followin
- Scope qualifications of one identifier - C++ standard: 256, Microsoft C++ compiler: 127.
-- Nested **`extern`** specifications - C++ standard: 1024, Microsoft C++ compiler: 9 (not counting the implicit **`extern`** specification in global scope, or 10, if you count the implicit **`extern`** specification in global scope..
+- Nested **`extern`** specifications - C++ standard: 1024, Microsoft C++ compiler: 9 (not counting the implicit **`extern`** specification in global scope, or 10, if you count the implicit **`extern`** specification in global scope.
- Template arguments in a template declaration - C++ standard: 1024, Microsoft C++ compiler: 2046.
diff --git a/docs/cpp/const-and-volatile-pointers.md b/docs/cpp/const-and-volatile-pointers.md
index cca4371b50..b786fcb6b4 100644
--- a/docs/cpp/const-and-volatile-pointers.md
+++ b/docs/cpp/const-and-volatile-pointers.md
@@ -1,9 +1,8 @@
---
-description: "Learn more about: const and volatile pointers"
title: "const and volatile pointers"
+description: "Learn more about: const and volatile pointers"
ms.date: "11/19/2019"
helpviewer_keywords: ["volatile keyword [C++], and pointers", "pointers, and const", "pointers, and volatile", "const keyword [C++], volatile pointers"]
-ms.assetid: 0c92dc6c-400e-4342-b345-63ddfe649d7e
---
# const and volatile pointers
@@ -117,5 +116,5 @@ int main() {
## See also
-[Pointers](pointers-cpp.md)
+[Pointers](pointers-cpp.md)\
[Raw pointers](raw-pointers.md)
diff --git a/docs/cpp/cpp-language-reference.md b/docs/cpp/cpp-language-reference.md
index f5316639df..7165a7aa29 100644
--- a/docs/cpp/cpp-language-reference.md
+++ b/docs/cpp/cpp-language-reference.md
@@ -1,10 +1,9 @@
---
-description: "Learn more about: C++ Language Reference"
title: "C++ Language Reference"
+description: "Learn more about: C++ Language Reference"
ms.custom: "index-page"
-ms.date: "12/10/2019"
+ms.date: 12/10/2019
helpviewer_keywords: ["C++, language reference"]
-ms.assetid: 4be9cacb-c862-4391-894a-3a118c9c93ce
---
# C++ Language Reference
@@ -14,96 +13,95 @@ For an overview of Modern C++ programming practices, see [Welcome Back to C++](w
See the following tables to quickly find a keyword or operator:
-- [C++ Keywords](../cpp/keywords-cpp.md)
-
-- [C++ Operators](../cpp/cpp-built-in-operators-precedence-and-associativity.md)
+- [C++ Keywords](keywords-cpp.md)
+- [C++ Operators](cpp-built-in-operators-precedence-and-associativity.md)
## In This Section
-[Lexical Conventions](../cpp/lexical-conventions.md)
+[Lexical Conventions](lexical-conventions.md)\
Fundamental lexical elements of a C++ program: tokens, comments, operators, keywords, punctuators, literals. Also, file translation, operator precedence/associativity.
-[Basic Concepts](../cpp/basic-concepts-cpp.md)
+[Basic Concepts](basic-concepts-cpp.md)\
Scope, linkage, program startup and termination, storage classes, and types.
-[Built-in types](fundamental-types-cpp.md)
+[Built-in types](fundamental-types-cpp.md)\
The fundamental types that are built into the C++ compiler and their value ranges.
-[Standard Conversions](../cpp/standard-conversions.md)
+[Standard Conversions](standard-conversions.md)\
Type conversions between built-in types. Also, arithmetic conversions and conversions among pointer, reference, and pointer-to-member types.
-[Declarations and definitions](declarations-and-definitions-cpp.md)
+[Declarations and definitions](declarations-and-definitions-cpp.md)\
Declaring and defining variables, types and functions.
-[Operators, Precedence and Associativity](../cpp/cpp-built-in-operators-precedence-and-associativity.md)
+[Operators, Precedence and Associativity](cpp-built-in-operators-precedence-and-associativity.md)\
The operators in C++.
-[Expressions](../cpp/expressions-cpp.md)
+[Expressions](expressions-cpp.md)\
Types of expressions, semantics of expressions, reference topics on operators, casting and casting operators, run-time type information.
-[Lambda Expressions](../cpp/lambda-expressions-in-cpp.md)
+[Lambda Expressions](lambda-expressions-in-cpp.md)\
A programming technique that implicitly defines a function object class and constructs a function object of that class type.
-[Statements](../cpp/statements-cpp.md)
+[Statements](statements-cpp.md)\
Expression, null, compound, selection, iteration, jump, and declaration statements.
-[Classes and structs](../cpp/classes-and-structs-cpp.md)
+[Classes and structs](classes-and-structs-cpp.md)\
Introduction to classes, structures, and unions. Also, member functions, special member functions, data members, bit fields, **`this`** pointer, nested classes.
-[Unions](unions.md)
+[Unions](unions.md)\
User-defined types in which all members share the same memory location.
-[Derived Classes](../cpp/inheritance-cpp.md)
+[Derived Classes](inheritance-cpp.md)\
Single and multiple inheritance, **`virtual`** functions, multiple base classes, **abstract** classes, scope rules. Also, the **`__super`** and **`__interface`** keywords.
-[Member-Access Control](../cpp/member-access-control-cpp.md)
+[Member-Access Control](member-access-control-cpp.md)\
Controlling access to class members: **`public`**, **`private`**, and **`protected`** keywords. Friend functions and classes.
-[Overloading](operator-overloading.md)
+[Overloading](operator-overloading.md)\
Overloaded operators, rules for operator overloading.
-[Exception Handling](../cpp/exception-handling-in-visual-cpp.md)
+[Exception Handling](exception-handling-in-visual-cpp.md)\
C++ exception handling, structured exception handling (SEH), keywords used in writing exception handling statements.
-[Assertion and User-Supplied Messages](../cpp/assertion-and-user-supplied-messages-cpp.md)
+[Assertion and User-Supplied Messages](assertion-and-user-supplied-messages-cpp.md)\
`#error` directive, the **`static_assert`** keyword, the `assert` macro.
-[Templates](../cpp/templates-cpp.md)
+[Templates](templates-cpp.md)\
Template specifications, function templates, class templates, **`typename`** keyword, templates vs. macros, templates and smart pointers.
-[Event Handling](../cpp/event-handling.md)
+[Event Handling](event-handling.md)\
Declaring events and event handlers.
-[Microsoft-Specific Modifiers](../cpp/microsoft-specific-modifiers.md)
+[Microsoft-Specific Modifiers](microsoft-specific-modifiers.md)\
Modifiers specific to Microsoft C++. Memory addressing, calling conventions, **`naked`** functions, extended storage-class attributes (**`__declspec`**), **`__w64`**.
-[Inline Assembler](../assembler/inline/inline-assembler.md)
+[Inline Assembler](../assembler/inline/inline-assembler.md)\
Using assembly language and C++ in **`__asm`** blocks.
-[Compiler COM Support](../cpp/compiler-com-support.md)
+[Compiler COM Support](compiler-com-support.md)\
A reference to Microsoft-specific classes and global functions used to support COM types.
-[Microsoft Extensions](../cpp/microsoft-extensions.md)
+[Microsoft Extensions](microsoft-extensions.md)\
Microsoft extensions to C++.
-[Nonstandard Behavior](../cpp/nonstandard-behavior.md)
+[Nonstandard Behavior](nonstandard-behavior.md)\
Information about nonstandard behavior of the Microsoft C++ compiler.
-[Welcome Back to C++](welcome-back-to-cpp-modern-cpp.md)
+[Welcome Back to C++](welcome-back-to-cpp-modern-cpp.md)\
An overview of modern C++ programming practices for writing safe, correct and efficient programs.
## Related Sections
-[Component Extensions for Runtime Platforms](../extensions/component-extensions-for-runtime-platforms.md)
+[Component Extensions for Runtime Platforms](../extensions/component-extensions-for-runtime-platforms.md)\
Reference material on using the Microsoft C++ compiler to target .NET.
-[C/C++ Building Reference](../build/reference/c-cpp-building-reference.md)
+[C/C++ Building Reference](../build/reference/c-cpp-building-reference.md)\
Compiler options, linker options, and other build tools.
-[C/C++ Preprocessor Reference](../preprocessor/c-cpp-preprocessor-reference.md)
+[C/C++ Preprocessor Reference](../preprocessor/c-cpp-preprocessor-reference.md)\
Reference material on pragmas, preprocessor directives, predefined macros, and the preprocessor.
-[Visual C++ Libraries](../standard-library/cpp-standard-library-reference.md)
+[Visual C++ Libraries](../standard-library/cpp-standard-library-reference.md)\
A list of links to the reference start pages for the various Microsoft C++ libraries.
## See also
diff --git a/docs/cpp/declspec.md b/docs/cpp/declspec.md
index 253de9e94d..443a140a7c 100644
--- a/docs/cpp/declspec.md
+++ b/docs/cpp/declspec.md
@@ -1,7 +1,7 @@
---
-description: "Learn more about: `__declspec`"
title: "__declspec"
-ms.date: 03/01/2022
+description: "Learn more about: `__declspec`"
+ms.date: 1/14/2025
f1_keywords: ["__declspec_cpp", "__declspec", "_declspec"]
helpviewer_keywords: ["__declspec keyword [C++]"]
---
@@ -9,7 +9,7 @@ helpviewer_keywords: ["__declspec keyword [C++]"]
**Microsoft Specific**
-The extended attribute syntax for specifying storage-class information uses the **`__declspec`** keyword, which specifies that an instance of a given type is to be stored with a Microsoft-specific storage-class attribute listed below. Examples of other storage-class modifiers include the **`static`** and **`extern`** keywords. However, these keywords are part of the ANSI specification of the C and C++ languages, and as such aren't covered by extended attribute syntax. The extended attribute syntax simplifies and standardizes Microsoft-specific extensions to the C and C++ languages.
+The extended attribute syntax for specifying storage-class information uses the `__declspec` keyword, which specifies that an instance of a given type is to be stored with a Microsoft-specific storage-class attribute listed below. Examples of other storage-class modifiers include the `static` and `extern` keywords. However, these keywords are part of the ANSI specification of the C and C++ languages, and as such aren't covered by extended attribute syntax. The extended attribute syntax simplifies and standardizes Microsoft-specific extensions to the C and C++ languages.
## Grammar
@@ -30,6 +30,7 @@ The extended attribute syntax for specifying storage-class information uses the
**`dllimport`**\
**`dllexport`**\
**`empty_bases`**\
+ **`hybrid_patchable`**\
**`jitintrinsic`**\
**`naked`**\
**`noalias`**\
@@ -49,7 +50,7 @@ The extended attribute syntax for specifying storage-class information uses the
White space separates the declaration modifier sequence. Examples appear in later sections.
-Extended attribute grammar supports these Microsoft-specific storage-class attributes: [`align`](../cpp/align-cpp.md), [`allocate`](../cpp/allocate.md), [`allocator`](../cpp/allocator.md), [`appdomain`](../cpp/appdomain.md), [`code_seg`](../cpp/code-seg-declspec.md), [`deprecated`](../cpp/deprecated-cpp.md), [`dllexport`](../cpp/dllexport-dllimport.md), [`dllimport`](../cpp/dllexport-dllimport.md), [`empty_bases`](../cpp/empty-bases.md), [`jitintrinsic`](../cpp/jitintrinsic.md), [`naked`](../cpp/naked-cpp.md), [`noalias`](../cpp/noalias.md), [`noinline`](../cpp/noinline.md), [`noreturn`](../cpp/noreturn.md), [`nothrow`](../cpp/nothrow-cpp.md), [`novtable`](../cpp/novtable.md), [`no_sanitize_address`](../cpp/no-sanitize-address.md),[`process`](../cpp/process.md), [`restrict`](../cpp/restrict.md), [`safebuffers`](../cpp/safebuffers.md), [`selectany`](../cpp/selectany.md), [`spectre`](../cpp/spectre.md), and [`thread`](../cpp/thread.md). It also supports these COM-object attributes: [`property`](../cpp/property-cpp.md) and [`uuid`](../cpp/uuid-cpp.md).
+Extended attribute grammar supports these Microsoft-specific storage-class attributes: [`align`](align-cpp.md), [`allocate`](allocate.md), [`allocator`](allocator.md), [`appdomain`](appdomain.md), [`code_seg`](code-seg-declspec.md), [`deprecated`](deprecated-cpp.md), [`dllexport`](dllexport-dllimport.md), [`dllimport`](dllexport-dllimport.md), [`empty_bases`](empty-bases.md), [`jitintrinsic`](jitintrinsic.md), [`naked`](naked-cpp.md), [`noalias`](noalias.md), [`noinline`](noinline.md), [`noreturn`](noreturn.md), [`nothrow`](nothrow-cpp.md), [`novtable`](novtable.md), [`no_sanitize_address`](no-sanitize-address.md), [`process`](process.md), [`restrict`](restrict.md), [`safebuffers`](safebuffers.md), [`selectany`](selectany.md), [`spectre`](spectre.md), and [`thread`](thread.md). It also supports these COM-object attributes: [`property`](property-cpp.md) and [`uuid`](uuid-cpp.md).
The **`code_seg`**, **`dllexport`**, **`dllimport`**, **`empty_bases`**, **`naked`**, **`noalias`**, **`nothrow`**, **`no_sanitize_address`**, **`property`**, **`restrict`**, **`selectany`**, **`thread`**, and **`uuid`** storage-class attributes are properties only of the declaration of the object or function to which they're applied. The **`thread`** attribute affects data and objects only. The **`naked`** and **`spectre`** attributes affect functions only. The **`dllimport`** and **`dllexport`** attributes affect functions, data, and objects. The **`property`**, **`selectany`**, and **`uuid`** attributes affect COM objects.
@@ -94,5 +95,5 @@ __declspec( thread ) int tls_i = 1;
## See also
-[Keywords](../cpp/keywords-cpp.md)\
+[Keywords](keywords-cpp.md)\
[C extended storage-class attributes](../c-language/c-extended-storage-class-attributes.md)
diff --git a/docs/cpp/equality-operators-equal-equal-and-exclpt-equal.md b/docs/cpp/equality-operators-equal-equal-and-exclpt-equal.md
index 0b19a7b204..c0853757bb 100644
--- a/docs/cpp/equality-operators-equal-equal-and-exclpt-equal.md
+++ b/docs/cpp/equality-operators-equal-equal-and-exclpt-equal.md
@@ -1,10 +1,9 @@
---
title: "Equality operators: == and !="
description: "The C++ standard language equal-to and not-equal-to operator syntax and use."
-ms.date: 07/23/2020
-f1_keywords: ["!=", "==", "not_eq_cpp"]
-helpviewer_keywords: ["!= operator", "equality operator", "not equal to comparison operator", "equality operator [C++], syntax", "== operator", "not_eq operator", "equal to operator"]
-ms.assetid: ba4e9659-2392-4fb4-be5a-910a2a6df45a
+ms.date: 08/09/2024
+f1_keywords: ["!=", "=="]
+helpviewer_keywords: ["!= operator", "equality operator", "not equal to operator", "equality operator [C++], syntax", "== operator", "equal to operator"]
---
# Equality operators: `==` and `!=`
@@ -15,38 +14,41 @@ ms.assetid: ba4e9659-2392-4fb4-be5a-910a2a6df45a
## Remarks
-The binary equality operators compare their operands for strict equality or inequality.
+The equal-to operator (**`==`**) returns **`true`** if both operands have the same value; otherwise **`false`**.\
+The not-equal-to operator (**`!=`**) returns **`true`** if the operands don't have the same value; otherwise **`false`**.
-The equality operators, equal to (**`==`**) and not equal to (**`!=`**), have lower precedence than the relational operators, but they behave similarly. The result type for these operators is **`bool`**.
-
-The equal-to operator (**`==`**) returns **`true`** if both operands have the same value; otherwise, it returns **`false`**. The not-equal-to operator (**`!=`**) returns **`true`** if the operands don't have the same value; otherwise, it returns **`false`**.
-
-## Operator keyword for !=
-
-C++ specifies **`not_eq`** as an alternative spelling for **`!=`**. (There's no alternative spelling for **`==`**.) In C, the alternative spelling is provided as a macro in the \ header. In C++, the alternative spelling is a keyword; use of \ or the C++ equivalent \ is deprecated. In Microsoft C++, the [`/permissive-`](../build/reference/permissive-standards-conformance.md) or [`/Za`](../build/reference/za-ze-disable-language-extensions.md) compiler option is required to enable the alternative spelling.
+In C and C++, **`not_eq`** can be used as alternative to **`!=`**. For more information, see [`not-eq`](../c-runtime-library/reference/not-eq.md).
## Example
```cpp
-// expre_Equality_Operators.cpp
-// compile with: /EHsc
#include
-using namespace std;
-
-int main() {
- cout << boolalpha
- << "The true expression 3 != 2 yields: "
- << (3 != 2) << endl
- << "The false expression 20 == 10 yields: "
- << (20 == 10) << endl;
+int main()
+{
+ int x = 1, y = 1, z = 2;
+
+ if (x == y)
+ {
+ std::cout << "Equal\n";
+ }
+
+ if (x != z)
+ {
+ std::cout << "Not equal\n";
+ }
}
```
-Equality operators can compare pointers to members of the same type. In such a comparison, pointer-to-member conversions are performed. Pointers to members can also be compared to a constant expression that evaluates to 0.
+```output
+Equal
+Not equal
+```
## See also
+[`not-eq`](../c-runtime-library/reference/not-eq.md)\
+[Operator overloading](../cpp/operator-overloading.md)\
[Expressions with binary operators](../cpp/expressions-with-binary-operators.md)\
[C++ built-in operators, precedence; and associativity](../cpp/cpp-built-in-operators-precedence-and-associativity.md)\
[C relational and equality operators](../c-language/c-relational-and-equality-operators.md)
diff --git a/docs/cpp/exception-specifications-throw-cpp.md b/docs/cpp/exception-specifications-throw-cpp.md
index d63159cfaf..268e410d73 100644
--- a/docs/cpp/exception-specifications-throw-cpp.md
+++ b/docs/cpp/exception-specifications-throw-cpp.md
@@ -1,9 +1,8 @@
---
-description: "Learn more about: Exception specifications (throw, noexcept) (C++)"
title: "Exception specifications (throw, noexcept) (C++)"
+description: "Learn more about: Exception specifications (throw, noexcept) (C++)"
ms.date: "01/18/2018"
helpviewer_keywords: ["exceptions [C++], exception specifications", "throwing exceptions [C++], throw keyword", "C++ exception handling [C++], throwing exceptions", "throw keyword [C++]", "noexcept keyword [C++]"]
-ms.assetid: 4d3276df-6f31-4c7f-8cab-b9d2d003a629
---
# Exception specifications (throw, noexcept) (C++)
@@ -25,7 +24,7 @@ The following table summarizes the Microsoft C++ implementation of exception spe
|Exception specification|Meaning|
|-----------------------------|-------------|
-|**`noexcept`**
`noexcept(true)`
`throw()`|The function does not throw an exception. In **`/std:c++14`** mode (which is the default), **`noexcept`** and `noexcept(true)` are equivalent. When an exception is thrown from a function that is declared **`noexcept`** or `noexcept(true)`, [`std::terminate`](../standard-library/exception-functions.md#terminate) is invoked. When an exception is thrown from a function declared as `throw()` in **`/std:c++14`** mode, the result is undefined behavior. No specific function is invoked. This is a divergence from the C++14 standard, which required the compiler to invoke [`std::unexpected`](../standard-library/exception-functions.md#unexpected).
**Visual Studio 2017 version 15.5 and later**: In **`/std:c++17`** mode , **`noexcept`**, `noexcept(true)`, and `throw()` are all equivalent. In **`/std:c++17`** mode, `throw()` is an alias for `noexcept(true)`. In **`/std:c++17`** mode and later, when an exception is thrown from a function declared with any of these specifications, [`std::terminate`](../standard-library/exception-functions.md#terminate) is invoked as required by the C++17 standard.|
+|**`noexcept`**
`noexcept(true)`
`throw()`|The function does not throw an exception. In **`/std:c++14`** mode (which is the default), **`noexcept`** and `noexcept(true)` are equivalent. When an exception is thrown from a function that is declared **`noexcept`** or `noexcept(true)`, [`std::terminate`](../standard-library/exception-functions.md#terminate) is invoked. When an exception is thrown from a function declared as `throw()` in **`/std:c++14`** mode, the result is undefined behavior. No specific function is invoked. This is a divergence from the C++14 standard, which required the compiler to invoke [`std::unexpected`](../standard-library/exception-functions.md#unexpected).
**Visual Studio 2017 version 15.5 and later**: In **`/std:c++17`** mode, **`noexcept`**, `noexcept(true)`, and `throw()` are all equivalent. In **`/std:c++17`** mode, `throw()` is an alias for `noexcept(true)`. In **`/std:c++17`** mode and later, when an exception is thrown from a function declared with any of these specifications, [`std::terminate`](../standard-library/exception-functions.md#terminate) is invoked as required by the C++17 standard.|
|`noexcept(false)`
`throw(...)`
No specification|The function can throw an exception of any type.|
|`throw(type)`| (**C++14 and earlier**) The function can throw an exception of type `type`. The compiler accepts the syntax, but interprets it as `noexcept(false)`. In **`/std:c++17`** mode and later, the compiler issues warning C5040.|
diff --git a/docs/cpp/function-overloading.md b/docs/cpp/function-overloading.md
index 694aa6e3d1..8f8c24a61a 100644
--- a/docs/cpp/function-overloading.md
+++ b/docs/cpp/function-overloading.md
@@ -1,6 +1,6 @@
---
-description: "Learn more about: Function Overloading"
title: "Function Overloading"
+description: "Learn more about: Function Overloading"
ms.date: 02/01/2023
helpviewer_keywords: ["function overloading [C++], about function overloading", "function overloading", "declaring functions [C++], overloading"]
---
@@ -307,7 +307,7 @@ public:
void Print( int i )
{
-};
+}
UDC udc;
diff --git a/docs/cpp/functions-cpp.md b/docs/cpp/functions-cpp.md
index 92c4ee5158..58670206a1 100644
--- a/docs/cpp/functions-cpp.md
+++ b/docs/cpp/functions-cpp.md
@@ -1,7 +1,7 @@
---
-description: "Learn more about: Functions (C++)"
title: "Functions (C++)"
-ms.date: "11/19/2018"
+description: "Learn more about: Functions (C++)"
+ms.date: 11/19/2018
helpviewer_keywords: ["defaults, arguments", "function definitions", "function definitions, about function definitions", "default arguments", "declarators, functions"]
---
# Functions (C++)
@@ -77,7 +77,6 @@ Optional parts of a function declaration are:
```cpp
//Declare printf with C linkage.
extern "C" int printf( const char *fmt, ... );
-
```
For more information, see [Translation units and linkage](../cpp/program-and-linkage-cpp.md).
diff --git a/docs/cpp/functions-with-variable-argument-lists-cpp.md b/docs/cpp/functions-with-variable-argument-lists-cpp.md
index 1fb884942d..9ded375dbc 100644
--- a/docs/cpp/functions-with-variable-argument-lists-cpp.md
+++ b/docs/cpp/functions-with-variable-argument-lists-cpp.md
@@ -1,66 +1,68 @@
---
description: "Learn more about: Functions with Variable Argument Lists (C++)"
title: "Functions with Variable Argument Lists (C++)"
-ms.date: "11/04/2016"
+ms.date: 05/01/2025
helpviewer_keywords: ["arguments [C++], variable number of", "variable argument lists", "declarators, functions", "argument lists [C++], variable number of", "declaring functions [C++], variables", "function calls, variable number of arguments"]
-ms.assetid: 27c2f83a-21dd-44c6-913c-2834cb944703
---
# Functions with Variable Argument Lists (C++)
-Function declarations in which the last member of is the ellipsis (...) can take a variable number of arguments. In these cases, C++ provides type checking only for the explicitly declared arguments. You can use variable argument lists when you need to make a function so general that even the number and types of arguments can vary. The family of functions is an example of functions that use variable argument lists.`printf`*argument-declaration-list*
+Function declarations that have ellipsis (...) as the last argument take a variable number of arguments. C++ provides type checking only for the explicitly declared arguments. You can use variable argument lists when the number and types of arguments to the function can vary. The `printf` family of functions is an example of functions that have variable argument lists.
## Functions with variable arguments
-To access arguments after those declared, use the macros contained in the standard include file \ as described below.
+To access arguments after those declared, use the macros contained in the standard include file `` as explained in this article.
**Microsoft Specific**
-Microsoft C++ allows the ellipsis to be specified as an argument if the ellipsis is the last argument and the ellipsis is preceded by a comma. Therefore, the declaration `int Func( int i, ... );` is legal, but `int Func( int i ... );` is not.
+Microsoft C++ allows the ellipsis to be specified as an argument if the ellipsis is the last argument and a comma comes before the ellipsis. Therefore, the declaration `int Func( int i, ... );` is legal, but `int Func( int i ... );` isn't.
**END Microsoft Specific**
-Declaration of a function that takes a variable number of arguments requires at least one placeholder argument, even if it is not used. If this placeholder argument is not supplied, there is no way to access the remaining arguments.
+Declaration of a function that takes a variable number of arguments requires at least one placeholder argument, even if it isn't used. If this placeholder argument isn't supplied, there's no way to access the remaining arguments.
-When arguments of type **`char`** are passed as variable arguments, they are converted to type **`int`**. Similarly, when arguments of type **`float`** are passed as variable arguments, they are converted to type **`double`**. Arguments of other types are subject to the usual integral and floating-point promotions. See [Standard Conversions](standard-conversions.md) for more information.
+When arguments of type **`char`** are passed as variable arguments, they're converted to type **`int`**. Similarly, when arguments of type **`float`** are passed as variable arguments, they're converted to type **`double`**. Arguments of other types are subject to the usual integral and floating-point promotions. For more information, see [Standard Conversions](standard-conversions.md).
-Functions that require variable lists are declared by using the ellipsis (...) in the argument list. Use the types and macros that are described in the \ include file to access arguments that are passed by a variable list. For more information about these macros, see [va_arg, va_copy, va_end, va_start](../c-runtime-library/reference/va-arg-va-copy-va-end-va-start.md). in the documentation for the C Run-Time Library.
+Functions that require variable lists are declared by using the ellipsis (...) in the argument list. Use the types and macros that are described in the `` include file to access arguments that are passed by a variable list. For more information about these macros, see [va_arg, va_copy, va_end, va_start](../c-runtime-library/reference/va-arg-va-copy-va-end-va-start.md).
-The following example shows how the macros work together with the type (declared in \):
+The following example shows how to use the macros to process a variable argument list:
```cpp
// variable_argument_lists.cpp
+
#include
#include
// Declaration, but not definition, of ShowVar.
void ShowVar( char *szTypes, ... );
+
int main() {
ShowVar( "fcsi", 32.4f, 'a', "Test string", 4 );
}
-// ShowVar takes a format string of the form
-// "ifcs", where each character specifies the
-// type of the argument in that position.
+// ShowVar takes a format string of the form
+// "ifcs", where each character specifies the
+// type of the argument in that position.
//
-// i = int
-// f = float
-// c = char
-// s = string (char *)
+// i = int
+// f = float
+// c = char
+// s = string (char *)
//
-// Following the format specification is a variable
-// list of arguments. Each argument corresponds to
-// a format character in the format string to which
+// Following the format specification is a variable
+// list of arguments. Each argument corresponds to
+// a format character in the format string to which
// the szTypes parameter points
void ShowVar( char *szTypes, ... ) {
va_list vl;
int i;
- // szTypes is the last argument specified; you must access
- // all others using the variable-argument macros.
+ // szTypes is the last argument specified; you must access
+ // all others using the variable-argument macros.
va_start( vl, szTypes );
// Step through the list.
for( i = 0; szTypes[i] != '\0'; ++i ) {
+
union Printable_t {
int i;
float f;
@@ -68,45 +70,44 @@ void ShowVar( char *szTypes, ... ) {
char *s;
} Printable;
- switch( szTypes[i] ) { // Type to expect.
+ switch( szTypes[i] ) { // Type to expect
case 'i':
Printable.i = va_arg( vl, int );
printf_s( "%i\n", Printable.i );
- break;
+ break;
case 'f':
Printable.f = va_arg( vl, double );
printf_s( "%f\n", Printable.f );
- break;
+ break;
case 'c':
Printable.c = va_arg( vl, char );
printf_s( "%c\n", Printable.c );
- break;
+ break;
case 's':
Printable.s = va_arg( vl, char * );
printf_s( "%s\n", Printable.s );
- break;
+ break;
default:
- break;
+ break;
}
}
va_end( vl );
}
-//Output:
-// 32.400002
-// a
-// Test string
+```
+
+```Output
+32.400002
+a
+Test string
```
The previous example illustrates these important concepts:
1. You must establish a list marker as a variable of type `va_list` before any variable arguments are accessed. In the previous example, the marker is called `vl`.
-
1. The individual arguments are accessed by using the `va_arg` macro. You must tell the `va_arg` macro the type of argument to retrieve so that it can transfer the correct number of bytes from the stack. If you specify an incorrect type of a size different from that supplied by the calling program to `va_arg`, the results are unpredictable.
-
1. You should explicitly cast the result obtained by using the `va_arg` macro to the type that you want.
-
-You must call the macro to terminate variable-argument processing.`va_end`
+1. You must call the `va_end` macro to terminate variable-argument processing.
\ No newline at end of file
diff --git a/docs/cpp/how-to-create-and-use-shared-ptr-instances.md b/docs/cpp/how-to-create-and-use-shared-ptr-instances.md
index e98a1a2893..28e2e78d4a 100644
--- a/docs/cpp/how-to-create-and-use-shared-ptr-instances.md
+++ b/docs/cpp/how-to-create-and-use-shared-ptr-instances.md
@@ -2,7 +2,7 @@
description: "Learn more about: How to: Create and Use shared_ptr instances"
title: "How to: Create and use shared_ptr instances"
ms.custom: "how-to"
-ms.date: "05/26/2023"
+ms.date: "12/4/2024"
ms.topic: "conceptual"
---
# How to: Create and Use shared_ptr instances
@@ -68,7 +68,7 @@ int main()
## Example 1
-Whenever possible, use the [make_shared](../standard-library/memory-functions.md#make_shared) function to create a `shared_ptr` when the memory resource is created for the first time. `make_shared` is exception-safe. It uses the same call to allocate the memory for the control block and the resource, which reduces the construction overhead. If you don't use `make_shared`, then you have to use an explicit **`new`** expression to create the object before you pass it to the `shared_ptr` constructor. The following example shows various ways to declare and initialize a `shared_ptr` together with a new object.
+Whenever possible, use the [`make_shared`](../standard-library/memory-functions.md#make_shared) function to create a `shared_ptr` when the memory resource is created for the first time. `make_shared` is exception-safe. It uses the same call to allocate the memory for the control block and the resource, which reduces the construction overhead. If you don't use `make_shared`, then you have to use an explicit **`new`** expression to create the object before you pass it to the `shared_ptr` constructor. The following example shows various ways to declare and initialize a `shared_ptr` together with a new object.
[!code-cpp[stl_smart_pointers#1](codesnippet/CPP/how-to-create-and-use-shared-ptr-instances_1.cpp)]
@@ -98,7 +98,7 @@ You can pass a `shared_ptr` to another function in the following ways:
- Pass the `shared_ptr` by reference or const reference. In this case, the reference count isn't incremented, and the callee can access the pointer as long as the caller doesn't go out of scope. Or, the callee can decide to create a `shared_ptr` based on the reference, and become a shared owner. Use this option when the caller has no knowledge of the callee, or when you must pass a `shared_ptr` and want to avoid the copy operation for performance reasons.
-- Pass the underlying pointer or a reference to the underlying object. This enables the callee to use the object, but doesn't enable it to share ownership or extend the lifetime. If the callee creates a `shared_ptr` from the raw pointer, the new `shared_ptr` is independent from the original, and doesn't control the underlying resource. Use this option when the contract between the caller and callee clearly specifies that the caller retains ownership of the `shared_ptr` lifetime.
+- Pass the underlying pointer or a reference to the underlying object. This enables the callee to use the object, but it doesn't share ownership of the object with the caller's `shared_ptr`. Beware the case of the callee creating a `shared_ptr` from the passed raw pointer because the callee's `shared_ptr` has an independent reference count from the caller's `shared_ptr`. When the `shared_ptr` in the callee goes out of scope, it will delete the object, leaving the pointer in the caller's 'shared_ptr' pointing at released memory. When the caller's `shared_ptr` then goes out of scope, a double-free results. Only use this option when the contract between the caller and callee clearly specifies that the caller retains ownership of the `shared_ptr` lifetime.
- When you're deciding how to pass a `shared_ptr`, determine whether the callee has to share ownership of the underlying resource. An "owner" is an object or function that can keep the underlying resource alive for as long as it needs it. If the caller has to guarantee that the callee can extend the life of the pointer beyond its (the function's) lifetime, use the first option. If you don't care whether the callee extends the lifetime, then pass by reference and let the callee copy it or not.
diff --git a/docs/cpp/hybrid-patchable.md b/docs/cpp/hybrid-patchable.md
new file mode 100644
index 0000000000..49dc470455
--- /dev/null
+++ b/docs/cpp/hybrid-patchable.md
@@ -0,0 +1,49 @@
+---
+description: "Learn more about: hybrid_patchable (C++)"
+title: "hybrid_patchable (C++)"
+ms.date: 1/15/2025
+f1_keywords: ["hybrid_patchable"]
+helpviewer_keywords: ["__declspec keyword [C++], hybrid_patchable", "hybrid_patchable __declspec keyword"]
+---
+# `hybrid_patchable` (C++)
+
+**Microsoft Specific**
+
+Use `__declspec(hybrid_patchable)` to mark a function as a hybrid patchable function. This attribute generates a fast-forward sequence. Fast-forward sequences are small x64 functions which contain no real logic, and tail-call the real Arm64EC function. Because fast-forward sequences are primarily used for hooking, if they are unaltered, execution is transferred directly to the Arm64EC function.
+
+## Syntax
+
+> `__declspec(hybrid_patchable)`
+
+## Remarks
+
+`__declspec(hybrid_patchable)` is an ARM64EC-only feature.
+
+**Example:**
+
+```cpp
+__declspec(hybrid_patchable) int Example()
+{
+ return 1;
+}
+```
+
+Generates the following fast-forward sequence:
+
+```
+EXP+#Example:
+ 00000001400CE000: 48 8B C4 mov rax,rsp
+ 00000001400CE003: 48 89 58 20 mov qword ptr [rax+20h],rbx
+ 00000001400CE007: 55 push rbp
+ 00000001400CE008: 5D pop rbp
+ 00000001400CE009: E9 BA 7A F3 FF jmp #Example
+ 00000001400CE00E: CC int 3
+ 00000001400CE00F: CC int 3
+```
+
+**END Microsoft Specific**
+
+## See also
+
+[`__declspec`](../cpp/declspec.md)\
+[Fast-Forward sequences](/windows/arm/arm64ec-abi#fast-forward-sequences)
\ No newline at end of file
diff --git a/docs/cpp/if-else-statement-cpp.md b/docs/cpp/if-else-statement-cpp.md
index c8252c9f23..21563cb749 100644
--- a/docs/cpp/if-else-statement-cpp.md
+++ b/docs/cpp/if-else-statement-cpp.md
@@ -164,7 +164,7 @@ setting shared_flag to false
Error! Token must not be a keyword
```
-## if constexpr statements
+## if constexpr statements
Starting in C++17, you can use an **`if constexpr`** statement in function templates to make compile-time branching decisions without having to resort to multiple function overloads. **Microsoft-specific**: This form is available starting in Visual Studio 2017 version 15.3, and requires at least the [`/std:c++17`](../build/reference/std-specify-language-standard-version.md) compiler option.
diff --git a/docs/cpp/import-export-module.md b/docs/cpp/import-export-module.md
index 349708fa55..ae7d37a4fe 100644
--- a/docs/cpp/import-export-module.md
+++ b/docs/cpp/import-export-module.md
@@ -1,13 +1,13 @@
---
title: "module, import, export"
-ms.date: 02/14/2022
+ms.date: 02/13/2025
f1_keywords: ["module_cpp", "import_cpp", "export_cpp"]
helpviewer_keywords: ["modules [C++]", "modules [C++], import", "modules [C++], export"]
description: Use import and export declarations to access and to publish types and functions defined in the specified module.
---
# `module`, `import`, `export`
-The **`module`**, **`import`**, and **`export`** declarations are available in C++20 and require the [`/experimental:module`](../build/reference/experimental-module.md) compiler switch along with [`/std:c++20`](../build/reference/std-specify-language-standard-version.md) or later (such as **`/std:c++latest`**). For more information, see [Overview of modules in C++](modules-cpp.md).
+The **`module`**, **`import`**, and **`export`** declarations are available in C++20 and require the compiler switch [`/std:c++20`](../build/reference/std-specify-language-standard-version.md) or later. For more information, see [Overview of modules in C++](modules-cpp.md).
## `module`
@@ -19,7 +19,7 @@ module ModuleA;
## `export`
-Use an **`export module`** declaration for the module's primary interface file, which must have extension *`.ixx`*:
+Use an **`export module`** declaration for the module's primary interface file, which has an extension *`.ixx`* by default. If you want to use a different extension, use the [/interface](../build/reference/interface.md) switch to compile it as a module interface.
```cpp
export module ModuleA;
@@ -40,11 +40,9 @@ namespace ModuleA_NS
}
```
-Non-exported names aren't visible to code that imports the module:
+Nonexported names aren't visible to code that imports the module:
```cpp
-//MyProgram.cpp
-
import ModuleA;
int main() {
@@ -64,9 +62,8 @@ Use an **`import`** declaration to make a module's names visible in your program
module ModuleA;
#include "custom-lib.h"
-import std.core;
-import std.regex;
-import ModuleB;
+import std;
+import myModule;
// begin declarations here:
template
@@ -114,4 +111,5 @@ import // Always an identifier, never a keyword
## See Also
-[Overview of modules in C++](modules-cpp.md)
+[Overview of modules in C++](modules-cpp.md)\
+[Import the C++ standard library using modules](tutorial-import-stl-named-module.md)
\ No newline at end of file
diff --git a/docs/cpp/index.yml b/docs/cpp/index.yml
index c5f89b17cd..4ba7817947 100644
--- a/docs/cpp/index.yml
+++ b/docs/cpp/index.yml
@@ -7,6 +7,7 @@ metadata:
description: C++ programming reference for users of Microsoft C++ and Visual Studio.
ms.topic: landing-page
ms.date: 03/22/2022
+ ms.author: twhitney
ms.custom: intro-landing-hub
# linkListType: architecture | concept | deploy | download | get-started | how-to-guide | learn | overview | quickstart | reference | tutorial | video | whats-new
diff --git a/docs/cpp/inheritance-cpp.md b/docs/cpp/inheritance-cpp.md
index c024fafdcf..14660d3866 100644
--- a/docs/cpp/inheritance-cpp.md
+++ b/docs/cpp/inheritance-cpp.md
@@ -1,50 +1,54 @@
---
-description: "Learn more about: Inheritance (C++)"
-title: "Inheritance (C++)"
+title: "Inheritance (C++)"
+description: "Learn more about: Inheritance (C++)"
ms.date: "11/04/2016"
helpviewer_keywords: ["derived classes [C++]", "derived classes [C++], about derived classes", "classes [C++], derived"]
-ms.assetid: 3534ca19-d9ed-4a40-be1b-b921ad0e6956
---
-# Inheritance (C++)
+# Inheritance (C++)
This section explains how to use derived classes to produce extensible programs.
## Overview
-New classes can be derived from existing classes using a mechanism called "inheritance" (see the information beginning in [Single Inheritance](../cpp/single-inheritance.md)). Classes that are used for derivation are called "base classes" of a particular derived class. A derived class is declared using the following syntax:
+New classes can be derived from existing classes using a mechanism called "inheritance" (see the information beginning in [Single Inheritance](single-inheritance.md)). Classes that are used for derivation are called "base classes" of a particular derived class. A derived class is declared using the following syntax:
```cpp
-class Derived : [virtual] [access-specifier] Base
+class DerivedSingleBase : [virtual] [access-specifier] Base
{
- // member list
+ // member list
};
-class Derived : [virtual] [access-specifier] Base1,
- [virtual] [access-specifier] Base2, . . .
+
+class DerivedMultipleBases : [virtual] [access-specifier] Base1,
+ [virtual] [access-specifier] Base2, ...
{
- // member list
+ // member list
};
```
-After the tag (name) for the class, a colon appears followed by a list of base specifications. The base classes so named must have been declared previously. The base specifications may contain an access specifier, which is one of the keywords **`public`**, **`protected`** or **`private`**. These access specifiers appear before the base class name and apply only to that base class. These specifiers control the derived class's permission to use to members of the base class. See [Member-Access Control](../cpp/member-access-control-cpp.md) for information on access to base class members. If the access specifier is omitted, the access to that base is considered **`private`**. The base specifications may contain the keyword **`virtual`** to indicate virtual inheritance. This keyword may appear before or after the access specifier, if any. If virtual inheritance is used, the base class is referred to as a virtual base class.
+After the tag (name) for the class, a colon appears followed by a list of base specifications. The base classes so named must have been declared previously. The base specifications may contain an access specifier, which is one of the keywords [**`public`**](public-cpp.md), [**`protected`**](protected-cpp.md) or [**`private`**](private-cpp.md). These access specifiers appear before the base class name and apply only to that base class. These specifiers control the derived class's permission to use members of the base class. See [Member-Access Control](member-access-control-cpp.md) for information on access to base class members. If the access specifier is omitted, the access to that base is considered **`private`**. The base specifications may contain the keyword [**`virtual`**](virtual-cpp.md) to indicate virtual inheritance. This keyword may appear before or after the access specifier, if any. If virtual inheritance is used, the base class is referred to as a virtual base class.
-Multiple base classes can be specified, separated by commas. If a single base class is specified, the inheritance model is [Single inheritance](../cpp/single-inheritance.md). If more than one base class is specified, the inheritance model is called [Multiple inheritance](../cpp/multiple-base-classes.md).
+Multiple base classes can be specified, separated by commas. If a single base class is specified, the inheritance model is [Single inheritance](single-inheritance.md). If more than one base class is specified, the inheritance model is called [Multiple inheritance](multiple-base-classes.md).
The following topics are included:
-- [Single inheritance](../cpp/single-inheritance.md)
+- [Single inheritance](single-inheritance.md)
+
+- [Multiple base classes](multiple-base-classes.md)
+
+- [Virtual functions](virtual-functions.md)
-- [Multiple base classes](../cpp/multiple-base-classes.md)
+- [Explicit overrides](explicit-overrides-cpp.md)
-- [Virtual functions](../cpp/virtual-functions.md)
+- [Abstract classes](abstract-classes-cpp.md)
-- [Explicit overrides](../cpp/explicit-overrides-cpp.md)
+- [Summary of scope rules](summary-of-scope-rules.md)
-- [Abstract classes](../cpp/abstract-classes-cpp.md)
+**Microsoft Specific**
-- [Summary of scope rules](../cpp/summary-of-scope-rules.md)
+The [`__super`](super.md) and [`__interface`](interface.md) keywords are documented in this section.
-The [__super](../cpp/super.md) and [__interface](../cpp/interface.md) keywords are documented in this section.
+**END Microsoft Specific**
## See also
-[C++ Language Reference](../cpp/cpp-language-reference.md)
+[C++ Language Reference](cpp-language-reference.md)
diff --git a/docs/cpp/keywords-cpp.md b/docs/cpp/keywords-cpp.md
index 5c0b32ebda..0bb5fff6c0 100644
--- a/docs/cpp/keywords-cpp.md
+++ b/docs/cpp/keywords-cpp.md
@@ -4,7 +4,6 @@ description: "Lists the C++ standard language keywords, Microsoft-specific keywo
ms.custom: "index-page"
ms.date: 07/25/2020
helpviewer_keywords: ["keywords [C++]"]
-ms.assetid: d7ca94a8-f785-41ce-9f73-d3c4fd508489
---
# Keywords (C++)
@@ -79,7 +78,7 @@ Keywords are predefined reserved identifiers that have special meanings. They ca
[`private`](private-cpp.md)\
[`protected`](protected-cpp.md)\
[`public`](public-cpp.md)\
- [`register`](storage-classes-cpp.md#register)
+ [`register`](storage-classes-cpp.md#register)\
[`reinterpret_cast`](reinterpret-cast-operator.md)\
**`requires`** c\
[`return`](return-statement-cpp.md)\
@@ -287,5 +286,5 @@ These identifiers are extended attributes for the **`__declspec`** modifier. The
## See also
-[Lexical conventions](lexical-conventions.md)
+[Lexical conventions](lexical-conventions.md)\
[C++ built-in operators, precedence, and associativity](cpp-built-in-operators-precedence-and-associativity.md)
diff --git a/docs/cpp/m64.md b/docs/cpp/m64.md
index 74c415036c..66800090f6 100644
--- a/docs/cpp/m64.md
+++ b/docs/cpp/m64.md
@@ -1,12 +1,11 @@
---
-description: "Learn more about: __m64"
title: "__m64"
+description: "Learn more about: __m64"
ms.date: "11/04/2016"
f1_keywords: ["__m64_cpp"]
helpviewer_keywords: ["__m64 keyword [C++]"]
-ms.assetid: df0410e8-67c9-4954-88c8-fe2653575252
---
-# __m64
+# `__m64`
**Microsoft Specific**
@@ -15,9 +14,10 @@ The **`__m64`** data type is for use with the MMX and 3DNow! intrinsics, and is
```cpp
// data_types__m64.cpp
#include
+
int main()
{
- __m64 x;
+ __m64 x;
}
```
@@ -25,14 +25,14 @@ int main()
You should not access the **`__m64`** fields directly. You can, however, see these types in the debugger. A variable of type **`__m64`** maps to the MM[0-7] registers.
-Variables of type **_m64** are automatically aligned on 8-byte boundaries.
+Variables of type **`__m64`** are automatically aligned on 8-byte boundaries.
-The **`__m64`** data type is not supported on x64 processors. Applications that use __m64 as part of MMX intrinsics must be rewritten to use equivalent SSE and SSE2 intrinsics.
+The **`__m64`** data type is not supported on x64 processors. Applications that use **`__m64`** as part of MMX intrinsics must be rewritten to use equivalent SSE and SSE2 intrinsics.
**END Microsoft Specific**
## See also
-[Keywords](../cpp/keywords-cpp.md)
-[Built-in types](../cpp/fundamental-types-cpp.md)
-[Data Type Ranges](../cpp/data-type-ranges.md)
+[Keywords](keywords-cpp.md)\
+[Built-in types](fundamental-types-cpp.md)\
+[Data Type Ranges](data-type-ranges.md)
diff --git a/docs/cpp/main-function-command-line-args.md b/docs/cpp/main-function-command-line-args.md
index 9e632f6251..ac291e1374 100644
--- a/docs/cpp/main-function-command-line-args.md
+++ b/docs/cpp/main-function-command-line-args.md
@@ -169,7 +169,7 @@ Command-line arguments are handled by an internal routine in the runtime startup
For more information on runtime startup linker options, see [Link options](../c-runtime-library/link-options.md).
-## Customize C++ command-line processing
+## Customize C++ command-line processing
If your program doesn't take command-line arguments, you can suppress the command-line processing routine to save a small amount of space. To suppress its use, include the *`noarg.obj`* file (for both `main` and `wmain`) in your **`/link`** compiler options or your **`LINK`** command line.
diff --git a/docs/cpp/microsoft-specific-modifiers.md b/docs/cpp/microsoft-specific-modifiers.md
index 3d8fc86562..fda7e96615 100644
--- a/docs/cpp/microsoft-specific-modifiers.md
+++ b/docs/cpp/microsoft-specific-modifiers.md
@@ -1,8 +1,7 @@
---
-description: "Learn more about: Microsoft-specific modifiers"
title: "Microsoft-specific modifiers"
+description: "Learn more about: Microsoft-specific modifiers"
ms.date: "08/16/2018"
-ms.assetid: 22c7178c-f854-47fa-9de6-07d23fda58e1
---
# Microsoft-specific modifiers
@@ -29,7 +28,7 @@ Many of the Microsoft-specific keywords can be used to modify declarators to for
|[__restrict](extension-restrict.md)|Similar to __declspec([restrict](restrict.md)), but for use on variables.|No|
|[__stdcall](stdcall.md)|The name that follows specifies a function that observes the standard calling convention.|Yes|
|[__w64](w64.md)|Marks a data type as being larger on a 64-bit compiler.|No|
-|[__unaligned](unaligned.md)|Specifies that a pointer to a type or other data is not aligned..|No|
+|[__unaligned](unaligned.md)|Specifies that a pointer to a type or other data is not aligned.|No|
|[__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|
## See also
diff --git a/docs/cpp/modules-cpp.md b/docs/cpp/modules-cpp.md
index bfdbfb7346..309913a75b 100644
--- a/docs/cpp/modules-cpp.md
+++ b/docs/cpp/modules-cpp.md
@@ -1,8 +1,8 @@
---
title: "Overview of modules in C++"
-ms.date: 01/29/2024
-helpviewer_keywords: ["modules [C++]", "modules [C++], overview"]
description: Modules in C++20 provide a modern alternative to header files.
+ms.date: 04/17/2025
+helpviewer_keywords: ["modules [C++]", "modules [C++], overview"]
---
# Overview of modules in C++
@@ -14,44 +14,15 @@ You can use modules side by side with header files. A C++ source file can `impor
To contrast modules with other ways to import the standard library, see [Compare header units, modules, and precompiled headers](../build/compare-inclusion-methods.md).
-## Enable modules in the Microsoft C++ compiler
-
-As of Visual Studio 2022 version 17.1, C++20 standard modules are fully implemented in the Microsoft C++ compiler.
-
-Before it was specified by the C++20 standard, Microsoft had experimental support for modules. The compiler also supported importing prebuilt Standard Library modules, described below.
-
-Starting with Visual Studio 2022 version 17.5, importing the Standard Library as a module is both standardized and fully implemented in the Microsoft C++ compiler. This section describes the older, experimental method, which is still supported. For information about the new standardized way to import the Standard Library using modules, see [Import the C++ standard library using modules](tutorial-import-stl-named-module.md).
+Starting with Visual Studio 2022 version 17.5, importing the Standard Library as a module is both standardized and fully implemented in the Microsoft C++ compiler. To learn how to import the Standard Library using modules, see [Import the C++ standard library using modules](tutorial-import-stl-named-module.md).
-You can use the modules feature to create single-partition modules and to import the Standard Library modules provided by Microsoft. To enable support for Standard Library modules, compile with [`/experimental:module`](../build/reference/experimental-module.md) and [`/std:c++latest`](../build/reference/std-specify-language-standard-version.md). In a Visual Studio project, right-click the project node in **Solution Explorer** and choose **Properties**. Set the **Configuration** drop-down to **All Configurations**, then choose **Configuration Properties** > **C/C++** > **Language** > **Enable C++ Modules (experimental)**.
+## Single-partition modules
-A module and the code that consumes it must be compiled with the same compiler options.
+A single-partition module is a module that consists of a single source file. The module interface and implementation are in the same file.
-## Consume C++ Standard Library as modules (experimental)
+The following single-partition module example shows a simple module definition in a source file called *`Example.ixx`*. The *`.ixx`* extension is the default extension for module interface files in Visual Studio. If you want to use a different extension, use the [/interface](../build/reference/interface.md) switch to compile it as a module interface. In this example, the interface file contains both the function definition and the declaration. You can also place the definitions in one or more separate module implementation files, as shown in a later example, but this is an example of a single-partition module.
-This section describes the experimental implementation, which is still supported. The new standardized way of consuming the C++ Standard Library as modules is described in [Import the C++ standard library using modules](tutorial-import-stl-named-module.md).
-
-By importing the C++ Standard Library as modules rather than including it through header files, you can potentially speed up compilation times depending on the size of your project. The experimental library is split into the following named modules:
-
-- `std.regex` provides the content of header ``
-- `std.filesystem` provides the content of header ``
-- `std.memory` provides the content of header ``
-- `std.threading` provides the contents of headers ``, ``, ``, ``, ``, and ``
-- `std.core` provides everything else in the C++ Standard Library
-
-To consume these modules, add an import declaration to the top of the source code file. For example:
-
-```cpp
-import std.core;
-import std.regex;
-```
-
-To consume the Microsoft Standard Library modules, compile your program with the [`/EHsc`](../build/reference/eh-exception-handling-model.md) and [`/MD`](../build/reference/md-mt-ld-use-run-time-library.md) options.
-
-## Example
-
-The following example shows a simple module definition in a source file called *`Example.ixx`*. The *`.ixx`* extension is required for module interface files in Visual Studio. In this example, the interface file contains both the function definition and the declaration. However, you can also place the definitions in one or more separate module implementation files, as shown in a later example.
-
-The `export module Example;` statement indicates that this file is the primary interface for a module called `Example`. The **`export`** modifier on `f()` indicates that this function is visible when another program or module imports `Example`.
+The `export module Example;` statement indicates that this file is the primary interface for a module called `Example`. The **`export`** modifier before `int f()` indicates that this function is visible when another program or module imports `Example`:
```cpp
// Example.ixx
@@ -61,12 +32,14 @@ export module Example;
namespace Example_NS
{
- int f_internal() {
- return ANSWER;
- }
+ int f_internal()
+ {
+ return ANSWER;
+ }
- export int f() {
- return f_internal();
+ export int f()
+ {
+ return f_internal();
}
}
```
@@ -75,8 +48,8 @@ The file *`MyProgram.cpp`* uses **`import`** to access the name exported by `Exa
```cpp
// MyProgram.cpp
+import std;
import Example;
-import std.core;
using namespace std;
@@ -88,7 +61,7 @@ int main()
}
```
-The `import` declaration can appear only at global scope.
+The `import` declaration can appear only at global scope. A module and the code that consumes it must be compiled with the same compiler options.
## Module grammar
@@ -133,15 +106,16 @@ The **`export`** keyword is only used in interface files. An implementation file
The rules for namespaces in modules are the same as any other code. If a declaration within a namespace is exported, the enclosing namespace (excluding members that aren't explicitly exported in that namespace) is also implicitly exported. If a namespace is explicitly exported, all declarations within that namespace definition are exported.
-When the compiler does argument-dependent lookup for overload resolutions in the importing translation unit, it considers functions declared in the same translation unit (including module interfaces) as where the type of the function's arguments are defined.
+When the compiler does argument-dependent lookup for overload resolution in the importing translation unit, it considers functions declared in the same translation unit (including module interfaces) as where the type of the function's arguments is defined.
### Module partitions
A module partition is similar to a module, except:
+
- It shares ownership of all declarations in the entire module.
- All names exported by partition interface files are imported and exported by the primary interface file.
- A partition's name must begin with the module name followed by a colon (`:`).
-- Declarations in any of the partitions are visible within the entire module.\
+- Declarations in any of the partitions are visible within the entire module.
- No special precautions are needed to avoid one-definition-rule (ODR) errors. You can declare a name (function, class, and so on) in one partition and define it in another.
A partition implementation file begins like this, and is an internal partition from a C++ standards perspective:
@@ -182,7 +156,7 @@ You can include header files in a module source file by putting an `#include` di
#include "customlib.h"
#include "anotherlib.h"
-import std.core;
+import std;
import MyModuleB;
//... rest of file
@@ -192,9 +166,10 @@ You can use a traditional header file to control which modules are imported:
```cpp
// MyProgram.h
-import std.core;
-#ifdef DEBUG_LOGGING
-import std.filesystem;
+#ifdef C_RUNTIME_GLOBALS
+import std.compat;
+#else
+import std;
#endif
```
@@ -209,6 +184,7 @@ import "myheader.h";
## See also
+[Import the C++ standard library using modules](tutorial-import-stl-named-module.md)\
[`module`, `import`, `export`](import-export-module.md)\
[Named modules tutorial](tutorial-named-modules-cpp.md)\
[Compare header units, modules, and precompiled headers](../build/compare-inclusion-methods.md)
diff --git a/docs/cpp/overload-resolution-of-function-template-calls.md b/docs/cpp/overload-resolution-of-function-template-calls.md
index 17455439ed..f8e8fc3031 100644
--- a/docs/cpp/overload-resolution-of-function-template-calls.md
+++ b/docs/cpp/overload-resolution-of-function-template-calls.md
@@ -1,9 +1,8 @@
---
-description: "Learn more about: Overload resolution of function template calls"
title: "Overload resolution of function template calls"
+description: "Learn more about: Overload resolution of function template calls"
ms.date: 09/27/2022
helpviewer_keywords: ["function templates overload resolution"]
-ms.assetid: a2918748-2cbb-4fc6-a176-e256f120bee4
---
# Overload resolution of function template calls
@@ -26,7 +25,7 @@ template
void f(T1, T2)
{
cout << "void f(T1, T2)" << endl;
-};
+}
int main()
{
@@ -58,7 +57,7 @@ template
void f(T1, T2)
{
cout << "void f(T1, T2)" << endl;
-};
+}
int main()
{
diff --git a/docs/cpp/program-and-linkage-cpp.md b/docs/cpp/program-and-linkage-cpp.md
index 85a25f8016..720e33de0f 100644
--- a/docs/cpp/program-and-linkage-cpp.md
+++ b/docs/cpp/program-and-linkage-cpp.md
@@ -11,7 +11,7 @@ In a C++ program, a *symbol*, for example a variable or function name, can be de
The following example shows some declarations:
```cpp
-int i;
+extern int i;
int f(int x);
class C;
```
diff --git a/docs/cpp/raw-pointers.md b/docs/cpp/raw-pointers.md
index 6b65cb30b1..c12c7051c6 100644
--- a/docs/cpp/raw-pointers.md
+++ b/docs/cpp/raw-pointers.md
@@ -334,7 +334,7 @@ int main()
## See also
-[Smart pointers](smart-pointers-modern-cpp.md)
-[Indirection Operator: *](indirection-operator-star.md)
-[Address-of Operator: &](address-of-operator-amp.md)
+[Smart pointers](smart-pointers-modern-cpp.md)\
+[Indirection Operator: *](indirection-operator-star.md)\
+[Address-of Operator: &](address-of-operator-amp.md)\
[Welcome back to C++](welcome-back-to-cpp-modern-cpp.md)
diff --git a/docs/cpp/stdcall.md b/docs/cpp/stdcall.md
index a6e9a50351..61ad524d75 100644
--- a/docs/cpp/stdcall.md
+++ b/docs/cpp/stdcall.md
@@ -13,6 +13,8 @@ The **`__stdcall`** calling convention is used to call Win32 API functions. The
## Syntax
> *return-type* **`__stdcall`** *function-name*[**`(`** *argument-list* **`)`**]
+>
+> **`auto`** **`__stdcall`** *function-name*[**`(`** *argument-list* **`)`**] [ **`->`** *return-type* ]
## Remarks
diff --git a/docs/cpp/string-and-character-literals-cpp.md b/docs/cpp/string-and-character-literals-cpp.md
index 70addb2b9b..643fd31dae 100644
--- a/docs/cpp/string-and-character-literals-cpp.md
+++ b/docs/cpp/string-and-character-literals-cpp.md
@@ -331,7 +331,10 @@ const size_t byteSize = (wcslen(str) + 1) * sizeof(wchar_t);
Notice that `strlen()` and `wcslen()` don't include the size of the terminating null character, whose size is equal to the element size of the string type: one byte on a `char*` or `char8_t*` string, two bytes on `wchar_t*` or `char16_t*` strings, and four bytes on `char32_t*` strings.
-In versions of Visual Studio before Visual Studio 2022 version 17.0, the maximum length of a string literal is 65,535 bytes. This limit applies to both narrow string literals and wide string literals. In Visual Studio 2022 version 17.0 and later, this restriction is lifted and string length is limited by available resources.
+Maximum length of a string literal after concatenation:
+
+* Visual Studio prior to 2022 version 17.0: the maximum length of a string literal after concatenation is 65,535 bytes. This applies to both narrow and wide string literals.
+* From Visual Studio 2022 version 17.0 onwards: the maximum length of a string literal after concatenation is only limited by available memory. However, the size limit before concatenation is still 16,384 bytes
### Modifying string literals
diff --git a/docs/cpp/this-pointer.md b/docs/cpp/this-pointer.md
index 1c1ea8223a..1b560dd372 100644
--- a/docs/cpp/this-pointer.md
+++ b/docs/cpp/this-pointer.md
@@ -147,7 +147,7 @@ The **`this`** pointer can't be reassigned. The **`const`** or **`volatile`** qu
| `void Func() volatile` | `volatile myClass *` |
| `void Func() const volatile` | `const volatile myClass *` |
-The following table explains more about `const` and `volatile``.
+The following table explains more about `const` and `volatile`.
### Semantics of `this` modifiers
diff --git a/docs/cpp/toc.yml b/docs/cpp/toc.yml
index 03a00af04c..35e1c6921a 100644
--- a/docs/cpp/toc.yml
+++ b/docs/cpp/toc.yml
@@ -696,6 +696,8 @@ items:
href: ../cpp/using-dllimport-and-dllexport-in-cpp-classes.md
- name: empty_bases
href: ../cpp/empty-bases.md
+ - name: hybrid_patchable
+ href: ../cpp/hybrid-patchable.md
- name: jitintrinsic
href: ../cpp/jitintrinsic.md
- name: naked
diff --git a/docs/cpp/transporting-exceptions-between-threads.md b/docs/cpp/transporting-exceptions-between-threads.md
index 343b25f91f..bddcb01e69 100644
--- a/docs/cpp/transporting-exceptions-between-threads.md
+++ b/docs/cpp/transporting-exceptions-between-threads.md
@@ -1,6 +1,6 @@
---
-description: "Learn more about: Transporting exceptions between threads"
title: "Transporting exceptions between threads"
+description: "Learn more about: Transporting exceptions between threads"
ms.date: 05/02/2023
helpviewer_keywords: ["std::current_exception", "transporting exceptions between threads", "std::copy_exception", "exception_ptr", "std::exception_ptr", "std::rethrow_exception", "current_exception", "transport exceptions between threads", "copy_exception", "rethrow_exception", "move exceptions between threads"]
---
@@ -244,6 +244,6 @@ exception_ptr 1: Caught a myException exception.
## See also
-[Exception Handling](../cpp/exception-handling-in-visual-cpp.md)
+[Exception Handling](../cpp/exception-handling-in-visual-cpp.md)\
[`/EH` (Exception Handling Model)](../build/reference/eh-exception-handling-model.md)\
[`/clr` (Common Language Runtime Compilation)](../build/reference/clr-common-language-runtime-compilation.md)
diff --git a/docs/cpp/tutorial-import-stl-named-module.md b/docs/cpp/tutorial-import-stl-named-module.md
index de5eec7bcf..b2c961353f 100644
--- a/docs/cpp/tutorial-import-stl-named-module.md
+++ b/docs/cpp/tutorial-import-stl-named-module.md
@@ -24,7 +24,7 @@ This tutorial requires Visual Studio 2022 17.5 or later.
## Introduction to standard library modules
-Header files suffer from semantics that can change depending on macro definitions, the order in which you include them, and they slow compilation. Modules solve these problems.
+Header file semantics can change depending on macro definitions, the order in which you include them, and they slow compilation. Modules solve these problems.
It's now possible to import the standard library as a module instead of as a tangle of header files. This is much faster and more robust than including header files or header units or precompiled headers (PCH).
@@ -39,14 +39,12 @@ Because named modules don't expose macros, macros like `assert`, `errno`, `offse
## About C++ modules
-Header files are how declarations and definitions have been shared between source files in C++. Prior to standard library modules, you'd include the part of the standard library you needed with a directive like `#include `. Header files are fragile and difficult to compose because their semantics may change depending on the order you include them, or whether certain macros are defined. They also slow compilation because they're reprocessed by every source file that includes them.
+Header files are how declarations and definitions have been shared between source files in C++. Before standard library modules, you'd include the part of the standard library you needed with a directive like `#include `. Header files are fragile and difficult to compose because their semantics may change depending on the order you include them, or whether certain macros are defined. They also slow compilation because they're reprocessed by every source file that includes them.
C++20 introduces a modern alternative called *modules*. In C++23, we were able to capitalize on module support to introduce named modules to represent the standard library.
Like header files, modules allow you to share declarations and definitions across source files. But unlike header files, modules aren't fragile and are easier to compose because their semantics don't change due to macro definitions or the order in which you import them. The compiler can process modules much faster than it can process `#include` files, and uses less memory at compile time as well. Named modules don't expose macro definitions or private implementation details.
-For in depth information about modules, see [Overview of modules in C++](modules-cpp.md) That article also discusses consuming the C++ standard library as modules, but uses an older and experimental way of doing it.
-
This article demonstrates the new and best way to consume the standard library. For more information about alternative ways to consume the standard library, see [Compare header units, modules, and precompiled headers](../build/compare-inclusion-methods.md).
## Import the standard library with `std`
@@ -57,7 +55,7 @@ The statement `import std;` or `import std.compat;` imports the standard library
### Example: How to build and import `std`
-1. Open a x86 Native Tools Command Prompt for VS: from the Windows **Start** menu, type *x86 native* and the prompt should appear in the list of apps. Ensure that the prompt is for Visual Studio 2022 version 17.5 or above. You'll get errors if you use the wrong version of the prompt. The examples used in this tutorial are for the CMD shell.
+1. Open a x86 Native Tools Command Prompt for VS: from the Windows **Start** menu, type *x86 native* and the prompt should appear in the list of apps. Ensure that the prompt is for Visual Studio 2022 version 17.5 or above. You get errors if you use the wrong version of the prompt. The examples used in this tutorial are for the CMD shell.
1. Create a directory, such as `%USERPROFILE%\source\repos\STLModules`, and make it the current directory. If you choose a directory that you don't have write access to, you'll get errors during compilation.
1. Compile the `std` named module with the following command:
diff --git a/docs/cpp/tutorial-named-modules-cpp.md b/docs/cpp/tutorial-named-modules-cpp.md
index 89830e7764..776ac6f114 100644
--- a/docs/cpp/tutorial-named-modules-cpp.md
+++ b/docs/cpp/tutorial-named-modules-cpp.md
@@ -1,6 +1,6 @@
---
title: "Named modules tutorial in C++"
-ms.date: 08/08/2022
+ms.date: 02/13/2025
ms.topic: "tutorial"
author: "tylermsft"
ms.author: "twhitney"
@@ -9,7 +9,7 @@ description: Named modules in C++20 provide a modern alternative to header files
---
# Named modules tutorial (C++)
-This tutorial is about creating C++20 modules. Modules replace header files. You'll learn how modules are an improvement on header files.
+This tutorial is about creating C++20 modules. Modules are a significant improvement on header files.
In this tutorial, learn how to:
@@ -22,13 +22,11 @@ In this tutorial, learn how to:
This tutorial requires Visual Studio 2022 17.1.0 or later.
-You might get IntelliSense errors while working on the code example in this tutorial. Work on the IntelliSense engine is catching up with the compiler. IntelliSense errors can be ignored and won't prevent the code example from building. To track progress on the IntelliSense work, see this [issue](https://developercommunity.visualstudio.com/t/When-importing-a-C20-module-or-header-/1550846).
-
## What are C++ modules
-Header files are how declarations and definitions are shared between source files in C++. Header files are fragile and difficult to compose. They may compile differently depending on the order you include them in, or on the macros that are or aren't defined. They can slow compilation time because they're reprocessed for each source file that includes them.
+Header files are how declarations and definitions are shared between source files in C++. Header files are fragile and may compile differently depending on the order you include them in or on the macros that are or aren't defined. They can slow compilation time because they're reprocessed for each source file that includes them.
-C++20 introduces a modern approach to componentizing C++ programs: *modules*.
+C++20 introduces *modules* as a modern approach to componentizing C++ programs.
Like header files, modules allow you to share declarations and definitions across source files. But unlike header files, modules don't leak macro definitions or private implementation details.
@@ -50,7 +48,7 @@ Your code can consume modules in the same project, or any referenced projects, a
## Create the project
-As we build a simple project, we'll look at various aspects of modules. The project will implement an API using a module instead of a header file.
+The following project implements an API using a module instead of a header file.
In Visual Studio 2022 or later, choose **Create a new project** and then the **Console App** (for C++) project type. If this project type isn't available, you may not have selected the **Desktop development with C++** workload when you installed Visual Studio. You can use the Visual Studio Installer to add the C++ workload.
@@ -62,7 +60,7 @@ Because modules are a C++20 feature, use the [`/std:c++20` or `/std:c++latest`](
## Create the primary module interface unit
-A module consists of one or more files. One of these files must be what is called the *primary module interface unit*. It defines what the module exports; that is, what importers of the module will see. There can only be one primary module interface unit per module.
+A module consists of one or more files. One of these files must be what is called the *primary module interface unit*. It defines what the module exports; that is, what importers of the module see. There can only be one primary module interface unit per module.
To add a primary module interface unit, in **Solution Explorer**, right-click **Source Files** then select **Add** > **Module**.
@@ -88,17 +86,17 @@ Replace the contents of *`BasicPlane.Figures.ixx`* file with:
export module BasicPlane.Figures; // the export module keywords mark this file as a primary module interface unit
```
-This line identifies this file as the primary module interface and gives the module a name: `BasicPlane.Figures`. The period in the module name has no special meaning to the compiler. A period can be used to convey how your module is organized. If you have multiple module files that work together, you can use periods to indicate a separation of concerns. In this tutorial, we'll use periods to indicate different functional areas of the API.
+This line identifies this file as the primary module interface and gives the module a name: `BasicPlane.Figures`. The period in the module name has no special meaning to the compiler. A period can be used to convey how your module is organized. If you have multiple module files that work together, you can use periods to indicate a separation of concerns. In this tutorial, periods indicate different functional areas of the API.
This name is also where the "named" in "named module" comes from. The files that are part of this module use this name to identify themselves as part of the named module. A named module is the collection of module units with the same module name.
We should talk about the API we'll implement for a moment before going further. It impacts the choices we make next. The API represents different shapes. We're only going to provide a couple shapes in this example: `Point` and `Rectangle`. `Point` is meant to be used as part of more complex shapes such as `Rectangle`.
-To illustrate some features of modules, we'll factor this API into pieces. One piece will be the `Point` API. The other part will be `Rectangle`. Imagine that this API will grow into something more complex. The division is useful for separating concerns or easing code maintenance.
+To illustrate some features of modules, we factor this API into parts. One part is the `Point` API. The other part is `Rectangle`. Imagine that this API could grow into something more complex. The division is useful for separating concerns or easing code maintenance.
So far, we've created the primary module interface that will expose this API. Let's now build the `Point` API. We want it to be part of this module. For reasons of logical organization, and potential build efficiency, we want to make the code for this part of the API a *module partition* file.
-Module partitions are useful for dividing the module implementation into manageable pieces. A module partition file is a piece, or component, of a module. What makes it unique is that it can be treated as an individual piece of the module--but only within the module. Module partitions can't be consumed outside of a module.
+Module partitions are useful for dividing the module implementation into manageable parts. A module partition file is part of a module. What makes it unique is that it can be treated as an individual parts of the module--but only within the module. Module partitions can't be consumed outside of a module.
When you import a partition into the primary module, all its declarations become visible to the primary module regardless of whether they're exported. Partitions can be imported into any partition interface, primary module interface, or module unit that belongs to the named module.
@@ -108,7 +106,7 @@ When you import a partition into the primary module, all its declarations become
To create a module partition file, in the **Solution Explorer** right-click **Source Files**, then select **Add** > **Module**. Name the file *`BasicPlane.Figures-Point.ixx`* and choose **Add**.
-Because it's a module partition file, we've added a hyphen and the name of the partition to the module name. This convention aids the compiler in the command-line case because the compiler uses name lookup rules based on the module name to find the compiled *`.ifc`* file for the partition. This way you don't have to provide explicit `/reference` command-line arguments to find the partitions that belong to the module. It's also helpful for organizing the files that belong to a module by name because you can easily see which files belong to which modules.
+Because it's a module partition file, we add a hyphen and the name of the partition to the module name. This convention aids the compiler in the command-line case because the compiler uses name lookup rules based on the module name to find the compiled *`.ifc`* file for the partition. This way you don't have to provide explicit `/reference` command-line arguments to find the partitions that belong to the module. It's also helpful for organizing the files that belong to a module by name because you can easily see which files belong to which modules.
Replace the contents of *`BasicPlane.Figures-Point.ixx`* with:
@@ -129,7 +127,7 @@ In this file, the `export` keyword makes `struct Point` visible to consumers.
### `Rectangle` module partition example
-The next partition we'll define is `Rectangle`. Create another module file using the same steps as before: In **Solution Explorer**, right-click on **Source Files**, then select **Add** > **Module**. Name the file *`BasicPlane.Figures-Rectangle.ixx`* and select **Add**.
+The next partition we define is `Rectangle`. Create another module file using the same steps as before: In **Solution Explorer**, right-click on **Source Files**, then select **Add** > **Module**. Name the file *`BasicPlane.Figures-Rectangle.ixx`* and select **Add**.
Replace the contents of *`BasicPlane.Figures-Rectangle.ixx`* with:
@@ -156,13 +154,13 @@ Next, `import :Point;` shows how to import a module partition. The `import` stat
Next, the code exports the definition of `struct Rectangle` and declarations for some functions that return various properties of the rectangle. The `export` keyword indicates whether to make what it precedes visible to consumers of the module. It's used to make the functions `area`, `height`, and `width` visible outside of the module.
-All definitions and declarations in a module partition are visible to the importing module unit whether they have the `export` keyword or not. The `export` keyword governs whether the definition, declaration, or typedef will be visible outside of the module when you export the partition in the primary module interface.
+All definitions and declarations in a module partition are visible to the importing module unit whether they have the `export` keyword or not. The `export` keyword governs whether the definition, declaration, or typedef is visible outside of the module when you export the partition in the primary module interface.
Names are made visible to consumers of a module in several ways:
- Put the keyword `export` in front of each type, function, and so on, that you want to export.
- If you put `export` in front of a namespace, for example `export namespace N { ... }`, everything defined within the braces is exported. But if elsewhere in the module you define `namespace N { struct S {...};}`, then `struct S` isn't available to consumers of the module. It's not available because that namespace declaration isn't prefaced by `export`, even though there's another namespace with the same name that is.
-- If a type, function, and so on, shouldn't be exported, omit the `export` keyword. It will be visible to other files that are part of the module, but not to importers of the module.
+- If a type, function, and so on, shouldn't be exported, omit the `export` keyword. It's visible to other files that are part of the module, but not to importers of the module.
- Use `module :private;` to mark the beginning of the private module partition. The private module partition is a section of the module where declarations are only visible to that file. They aren't visible to files that import this module or to other files that are part of this module. Think of it as a section that is static local to the file. This section is visible only within the file.
- To make an imported module or module partition visible, use `export import`. An example is shown in the next section.
@@ -179,11 +177,11 @@ export import :Point; // bring in the Point partition, and export it to consumer
export import :Rectangle; // bring in the Rectangle partition, and export it to consumers of this module
```
-The two lines that begin with `export import` are new here. When combined like this, these two keywords instruct the compiler to import the specified module and make it visible to consumers of this module. In this case, the colon (`:`) in the module name indicates that we are importing a module partition.
+The two lines that begin with `export import` are new here. When combined like this, these two keywords instruct the compiler to import the specified module and make it visible to consumers of this module. In this case, the colon (`:`) in the module name indicates that we're importing a module partition.
The imported names don't include the full module name. For example, the `:Point` partition was declared as `export module BasicPlane.Figures:Point`. Yet here we're importing `:Point`. Because we're in the primary module interface file for the module `BasicPlane.Figures`, the module name is implied, and only the partition name is specified.
-So far, we've defined the primary module interface, which exposes the API surface we want to make available. But we've only declared, not defined, `area()`, `height()`, or `width()`. We'll do that next by creating a module implementation file.
+So far, we've defined the primary module interface, which exposes the API surface we want to make available. But we've only declared, not defined, `area()`, `height()`, or `width()`. We do that next by creating a module implementation file.
## Create a module unit implementation file
@@ -219,7 +217,7 @@ Anything you declare within an implementation unit is only visible to the module
## Import the module
-Now we'll make use of the module we've defined. Open the *`ModulesTutorial.cpp`* file. It was created automatically as part of the project. It currently contains the function `main()`. Replace its contents with:
+Now we make use of the module we've defined. Open the *`ModulesTutorial.cpp`* file. It was created automatically as part of the project. It currently contains the function `main()`. Replace its contents with:
```cpp
#include
@@ -237,7 +235,7 @@ int main()
}
```
-The statement `import BasicPlane.Figures;` makes all the exported functions and types from the `BasicPlane.Figures` module visible to this file. It can come before or after any `#include` directives.
+The statement `import BasicPlane.Figures;` makes all the exported functions and types from the `BasicPlane.Figures` module visible to this file. It comes after any `#include` directives.
The app then uses the types and functions from the module to output the area and width of the defined rectangle:
@@ -252,7 +250,7 @@ Let's now look in more detail at the various module files.
### Primary module interface
-A module consists of one or more files. One of them defines the interface that importers will see. This file contains the *Primary module interface*. There can only be one primary module interface per module. As pointed out earlier, the exported module interface unit doesn't specify a module partition.
+A module consists of one or more files. One of them defines the interface that importers see. This file contains the *Primary module interface*. There can only be one primary module interface per module. As pointed out earlier, the exported module interface unit doesn't specify a module partition.
It has an *`.ixx`* extension by default. However, you can treat a source file with any extension as a module interface file. To do so, set the **Compile As** property in the **Advanced** tab for the source file's properties page to **Compile As Module (/interface)**:
@@ -265,7 +263,7 @@ module; // optional. Defines the beginning of the global module fragment
// #include directives go here but only apply to this file and
// aren't shared with other module implementation files.
-// Macro definitions aren't visible outside this file, or to importers.
+// Macro definitions aren't visible outside this file or to importers.
// import statements aren't allowed here. They go in the module preamble, below.
export module [module-name]; // Required. Marks the beginning of the module preamble
@@ -300,12 +298,13 @@ For a more in-depth look at module syntax, see [Modules](modules-cpp.md).
Module implementation units belong to a named module. The named module they belong to is indicated by the `module [module-name]` statement in the file. Module implementation units provide implementation details that, for code hygiene or other reasons, you don't want to put in the primary module interface or in a module partition file.
-Module implementation units are useful for breaking up a large module into smaller pieces, which can result in faster build times. This technique is covered briefly in the [Best practices](#module-best-practices) section.
+Module implementation units are useful for breaking up a large module into smaller parts, which can result in faster build times. This technique is covered briefly in the [Best practices](#module-best-practices) section.
Module implementation unit files have a *`.cpp`* extension. The basic outline of a module implementation unit file is:
```cpp
-// optional #include or import statements. These only apply to this file
+// optional #include statements. These only apply to this file
+// optional import statements. These only apply to this file
// imports in the associated module's interface are automatically available to this file
module [module-name]; // required. Identifies which named module this implementation unit belongs to
@@ -315,7 +314,7 @@ module [module-name]; // required. Identifies which named module this implementa
### Module partition files
-Module partitions provide a way to componentize a module into different pieces, or *partitions*. Module partitions are meant to be imported only in files that are part of the named module. They can't be imported outside of the named module.
+Module partitions provide a way to componentize a module into different parts, or *partitions*. Module partitions are meant to be imported only in files that are part of the named module. They can't be imported outside of the named module.
A partition has an interface file, and zero or more implementation files. A module partition shares ownership of all the declarations in the entire module.
@@ -358,7 +357,7 @@ A module and the code that imports it must be compiled with the same compiler op
- The name of the file that contains the module primary interface is generally the name of the module. For example, given the module name `BasicPlane.Figures`, the name of the file containing the primary interface would be named *`BasicPlane.Figures.ixx`*.
- The name of a module partition file is generally `-` where the name of the module is followed by a hyphen ('-') and then the name of the partition. For example, *`BasicPlane.Figures-Rectangle.ixx`*
-If you're building from the command line and you use this naming convention for module partitions, then you won't have to explicitly add `/reference` for each module partition file. The compiler will look for them automatically based on the name of the module. The name of the compiled partition file (ending with an *`.ifc`* extension) is generated from the module name. Consider the module name `BasicPlane.Figures:Rectangle`: the compiler will anticipate that the corresponding compiled partition file for `Rectangle` is named `BasicPlane.Figures-Rectangle.ifc`. The compiler uses this naming scheme to make it easier to use module partitions by automatically finding the interface unit files for partitions.
+If you're building from the command line and you use this naming convention for module partitions, then you won't have to explicitly add `/reference` for each module partition file. The compiler looks for them automatically based on the name of the module. The name of the compiled partition file is generated from the module name and ends in *`.ifc`*. Consider the module name `BasicPlane.Figures:Rectangle`: the compiler anticipates that the corresponding compiled partition file for `Rectangle` is named `BasicPlane.Figures-Rectangle.ifc`. The compiler uses this naming scheme to make it easier to use module partitions by automatically finding the interface unit files for partitions.
You can name them using your own convention. But then you'll need to specify corresponding [`/reference`](../build/reference/module-reference.md) arguments to the command-line compiler.
@@ -372,7 +371,7 @@ Module partitions make it easier to logically factor a large module. They can be
## Summary
-In this tutorial, you've been introduced to the basics of C++20 modules. You've created a primary module interface, defined a module partition, and built a module implementation file.
+In this tutorial, you were introduced to the basics of C++20 modules by creating a primary module interface, defined a module partition, and built a module implementation file.
## See also
diff --git a/docs/cpp/type-conversions-and-type-safety-modern-cpp.md b/docs/cpp/type-conversions-and-type-safety-modern-cpp.md
index 0d6fb436b4..dfa856f93b 100644
--- a/docs/cpp/type-conversions-and-type-safety-modern-cpp.md
+++ b/docs/cpp/type-conversions-and-type-safety-modern-cpp.md
@@ -1,9 +1,8 @@
---
-description: "Learn more about: Type conversions and type safety"
title: "Type conversions and type safety"
+description: "Learn more about: Type conversions and type safety"
ms.date: "11/19/2019"
ms.topic: "conceptual"
-ms.assetid: 629b361a-2ce1-4700-8b5d-ab4f57b245d5
---
# Type conversions and type safety
@@ -105,7 +104,7 @@ The C-style cast operator is identical to the call operator () and is therefore
int i = d; // warning C4244 possible loss of data
int j = static_cast(d); // No warning.
string s = static_cast(d); // Error C2440:cannot convert from
- // double to std:string
+ // double to std::string
// No error but not necessarily safe.
Base* b = new Base();
@@ -173,7 +172,7 @@ The C-style cast operator is identical to the call operator () and is therefore
## See also
-[C++ type system](../cpp/cpp-type-system-modern-cpp.md)
-[Welcome back to C++](../cpp/welcome-back-to-cpp-modern-cpp.md)
-[C++ Language Reference](../cpp/cpp-language-reference.md)
+[C++ type system](../cpp/cpp-type-system-modern-cpp.md)\
+[Welcome back to C++](../cpp/welcome-back-to-cpp-modern-cpp.md)\
+[C++ Language Reference](../cpp/cpp-language-reference.md)\
[C++ Standard Library](../standard-library/cpp-standard-library-reference.md)
diff --git a/docs/cpp/unhook.md b/docs/cpp/unhook.md
index c281450faf..146b6502e0 100644
--- a/docs/cpp/unhook.md
+++ b/docs/cpp/unhook.md
@@ -64,7 +64,7 @@ A pointer to the event handler method to be unhooked from an event. The handler
- Managed events: *`ReceiverClass`* is the event receiver class and *`HandlerMethod`* is the handler.
-*`receiver`*(optional)
+*`receiver`* (optional)
A pointer to an instance of the event receiver class. If you don't specify a receiver, the default is the receiver class or structure in which **`__unhook`** is called.
## Usage
diff --git a/docs/cpp/writing-an-exception-filter.md b/docs/cpp/writing-an-exception-filter.md
index cf3e4b3781..dfa69fb7df 100644
--- a/docs/cpp/writing-an-exception-filter.md
+++ b/docs/cpp/writing-an-exception-filter.md
@@ -16,25 +16,29 @@ For example, the following code uses a function call in the *filter* expression:
```cpp
// exceptions_Writing_an_Exception_Filter.cpp
#include
+int Eval_Exception(int);
int main() {
- int Eval_Exception( int );
-
- __try {}
-
- __except ( Eval_Exception( GetExceptionCode( ))) {
- ;
- }
-
+ __try {
+ ;
+ }
+ __except (Eval_Exception(GetExceptionCode())) {
+ ;
+ }
+}
+void HandleOverflow() {
+ // Gracefully recover
}
-void ResetVars( int ) {}
-int Eval_Exception ( int n_except ) {
- if ( n_except != STATUS_INTEGER_OVERFLOW &&
- n_except != STATUS_FLOAT_OVERFLOW ) // Pass on most exceptions
- return EXCEPTION_CONTINUE_SEARCH;
-
- // Execute some code to clean up problem
- ResetVars( 0 ); // initializes data to 0
- return EXCEPTION_CONTINUE_EXECUTION;
+int Eval_Exception(int n_except) {
+ if (
+ n_except != STATUS_INTEGER_OVERFLOW &&
+ n_except != STATUS_FLOAT_OVERFLOW
+ ) {
+ // Pass on most exceptions
+ return EXCEPTION_CONTINUE_SEARCH;
+ }
+ // Execute some code to clean up problem
+ HandleOverflow();
+ return EXCEPTION_CONTINUE_EXECUTION;
}
```
@@ -42,7 +46,7 @@ It's a good idea to use a function call in the *filter* expression whenever *fil
Note the use of [`GetExceptionCode`](/windows/win32/Debug/getexceptioncode) to determine the exception. This function must be called inside the filter expression of the **`__except`** statement. `Eval_Exception` can't call `GetExceptionCode`, but it must have the exception code passed to it.
-This handler passes control to another handler unless the exception is an integer or floating-point overflow. If it is, the handler calls a function (`ResetVars` is only an example, not an API function) to reset some global variables. The **`__except`** statement block, which in this example is empty, can never be executed because `Eval_Exception` never returns `EXCEPTION_EXECUTE_HANDLER` (1).
+This handler passes control to another handler unless the exception is an integer or floating-point overflow. If it is, the handler calls a function (`HandleOverflow` is only an example, not an API function) to appropriately try to recover from the exception. The **`__except`** statement block, which in this example is empty, can never be executed because `Eval_Exception` never returns `EXCEPTION_EXECUTE_HANDLER` (1).
Using a function call is a good general-purpose technique for dealing with complex filter expressions. Two other C language features that are useful are:
@@ -53,13 +57,13 @@ Using a function call is a good general-purpose technique for dealing with compl
The conditional operator is frequently useful here. It can be used to check for a specific return code and then return one of two different values. For example, the filter in the following code recognizes the exception only if the exception is `STATUS_INTEGER_OVERFLOW`:
```cpp
-__except( GetExceptionCode() == STATUS_INTEGER_OVERFLOW ? 1 : 0 ) {
+__except (GetExceptionCode() == STATUS_INTEGER_OVERFLOW ? 1 : 0)
```
The purpose of the conditional operator in this case is mainly to provide clarity, because the following code produces the same results:
```cpp
-__except( GetExceptionCode() == STATUS_INTEGER_OVERFLOW ) {
+__except (GetExceptionCode() == STATUS_INTEGER_OVERFLOW)
```
The conditional operator is more useful in situations where you might want the filter to evaluate to -1, `EXCEPTION_CONTINUE_EXECUTION`.
@@ -67,7 +71,7 @@ The conditional operator is more useful in situations where you might want the f
The comma operator lets you execute multiple expressions in sequence. It then returns the value of the last expression. For example, the following code stores the exception code in a variable and then tests it:
```cpp
-__except( nCode = GetExceptionCode(), nCode == STATUS_INTEGER_OVERFLOW )
+__except (nCode = GetExceptionCode(), nCode == STATUS_INTEGER_OVERFLOW)
```
## See also
diff --git a/docs/cppcx/codesnippet/CPP/partialclassexample/class1.h b/docs/cppcx/codesnippet/CPP/partialclassexample/class1.h
index 52efa84e74..9e8425b3b8 100644
--- a/docs/cppcx/codesnippet/CPP/partialclassexample/class1.h
+++ b/docs/cppcx/codesnippet/CPP/partialclassexample/class1.h
@@ -21,7 +21,7 @@ namespace PartialClassExample
/*
// This is commented out because it causes
- // a compile error in Delcaration #6 due to mc already being defined.
+ // a compile error in Declaration #6 due to mc already being defined.
// the error is understood. The example is most effective showing
// the various declaration rules all in one example like this.
//
diff --git a/docs/cppcx/collections-c-cx.md b/docs/cppcx/collections-c-cx.md
index cd7de0aa56..3d3caad993 100644
--- a/docs/cppcx/collections-c-cx.md
+++ b/docs/cppcx/collections-c-cx.md
@@ -1,8 +1,7 @@
---
-description: "Learn more about: Collections (C++/CX)"
title: "Collections (C++/CX)"
+description: "Learn more about: Collections (C++/CX)"
ms.date: "11/19/2018"
-ms.assetid: 914da30b-aac5-4cd7-9da3-a5ac08cdd72c
---
# Collections (C++/CX)
@@ -16,7 +15,7 @@ The Windows Runtime defines the interfaces for collections and related types, an
- The [Platform::Collections::Map class](../cppcx/platform-collections-map-class.md) resembles the [std::map class](../standard-library/map-class.md).
-- [Platform::Collections::VectorView class](../cppcx/platform-collections-vectorview-class.md) and[Platform::Collections::MapView class](../cppcx/platform-collections-mapview-class.md) are read-only versions of `Vector` and `Map`.
+- [Platform::Collections::VectorView class](../cppcx/platform-collections-vectorview-class.md) and [Platform::Collections::MapView class](../cppcx/platform-collections-mapview-class.md) are read-only versions of `Vector` and `Map`.
- Iterators are defined in the [Platform::Collections Namespace](../cppcx/platform-collections-namespace.md). These iterators satisfy the requirements for STL iterators and enable the use of [std::find](../standard-library/algorithm-functions.md#find), [std::count_if](../standard-library/algorithm-functions.md#count_if), and other STL algorithms on any [Windows::Foundation::Collections](/uwp/api/windows.foundation.collections) interface type or [Platform::Collections](../cppcx/platform-collections-namespace.md) concrete type. For example, this means that you can iterate a collection in a Windows Runtime component that's created in C# and apply an STL algorithm to it.
@@ -44,7 +43,7 @@ If you have existing code that uses `std::vector` and you want to reuse it in a
[!code-cpp[cx_collections#02](../cppcx/codesnippet/CPP/collections/class1.cpp#02)]
-If you have a vector of strings that you must pass across the ABI at some future point, you must decide whether to create the strings initially as `std::wstring` types or as `Platform::String^` types. If you have to do a lot of processing on the strings, then use `wstring`. Otherwise, create the strings as `Platform::String^` types and avoid the cost of converting them later. You must also decide whether to put these strings into a `std:vector` or `Platform::Collections::Vector` internally. As a general practice, use `std::vector` and then create a `Platform::Vector` from it only when you pass the container across the ABI.
+If you have a vector of strings that you must pass across the ABI at some future point, you must decide whether to create the strings initially as `std::wstring` types or as `Platform::String^` types. If you have to do a lot of processing on the strings, then use `wstring`. Otherwise, create the strings as `Platform::String^` types and avoid the cost of converting them later. You must also decide whether to put these strings into a `std::vector` or `Platform::Collections::Vector` internally. As a general practice, use `std::vector` and then create a `Platform::Vector` from it only when you pass the container across the ABI.
## Value types in Vector
@@ -95,27 +94,27 @@ Collections fall into four categories: modifiable versions and read-only version
Elements of a modifiable collection can be changed, but elements of a read-only collection, which is known as a *view*, can only be read. Elements of a [Platform::Collections::Vector](../cppcx/platform-collections-vector-class.md) or[Platform::Collections::VectorView](../cppcx/platform-collections-vectorview-class.md) collection can be accessed by using an iterator or the collection's [Vector::GetAt](../cppcx/platform-collections-vector-class.md#getat) and an index. Elements of an associative collection can be accessed by using the collection's [Map::Lookup](../cppcx/platform-collections-map-class.md#lookup) and a key.
-[Platform::Collections::Map class](../cppcx/platform-collections-map-class.md)
+[Platform::Collections::Map class](../cppcx/platform-collections-map-class.md)\
A modifiable, associative collection. Map elements are key-value pairs. Looking up a key to retrieve its associated value, and iterating through all key-value pairs, are both supported.
`Map` and `MapView` are templated on `>`; therefore, you can customize the comparator. Additionally, `Vector` and `VectorView` are templated on `>` so that you can customize the behavior of `IndexOf()`. This is important mostly for `Vector` and `VectorView` of value structs. For example, to create a Vector\, you must provide a custom comparator because DateTime does not overload the == operator.
-[Platform::Collections::MapView class](../cppcx/platform-collections-mapview-class.md)
+[Platform::Collections::MapView class](../cppcx/platform-collections-mapview-class.md)\
A read-only version of a `Map`.
-[Platform::Collections::Vector class](../cppcx/platform-collections-vector-class.md)
-A modifiable sequence collection. `Vector` supports constant-time random access and amortized-constant-time [Append](../cppcx/platform-collections-vector-class.md#append) operations..
+[Platform::Collections::Vector class](../cppcx/platform-collections-vector-class.md)\
+A modifiable sequence collection. `Vector` supports constant-time random access and amortized-constant-time [Append](../cppcx/platform-collections-vector-class.md#append) operations.
-[Platform::Collections::VectorView class](../cppcx/platform-collections-vectorview-class.md)
+[Platform::Collections::VectorView class](../cppcx/platform-collections-vectorview-class.md)\
A read-only version of a `Vector`.
-[Platform::Collections::InputIterator class](../cppcx/platform-collections-inputiterator-class.md)
+[Platform::Collections::InputIterator class](../cppcx/platform-collections-inputiterator-class.md)\
An STL iterator that satisfies the requirements of an STL input iterator.
-[Platform::Collections::VectorIterator class](../cppcx/platform-collections-vectoriterator-class.md)
+[Platform::Collections::VectorIterator class](../cppcx/platform-collections-vectoriterator-class.md)\
An STL iterator that satisfies the requirements of an STL mutable random-access iterator.
-[Platform::Collections::VectorViewIterator class](../cppcx/platform-collections-vectorviewiterator-class.md)
+[Platform::Collections::VectorViewIterator class](../cppcx/platform-collections-vectorviewiterator-class.md)\
An STL iterator that satisfies the requirements of an STL **`const`** random-access iterator.
### begin() and end() functions
@@ -140,6 +139,6 @@ The [Windows::Foundation::Collections::VectorChangedEventHandler](/uwp/api/windo
## See also
-[Type System](../cppcx/type-system-c-cx.md)
-[C++/CX Language Reference](../cppcx/visual-c-language-reference-c-cx.md)
+[Type System](../cppcx/type-system-c-cx.md)\
+[C++/CX Language Reference](../cppcx/visual-c-language-reference-c-cx.md)\
[Namespaces Reference](../cppcx/namespaces-reference-c-cx.md)
diff --git a/docs/cppcx/crt-functions-not-supported-in-universal-windows-platform-apps.md b/docs/cppcx/crt-functions-not-supported-in-universal-windows-platform-apps.md
index 602af8f276..9291df90cc 100644
--- a/docs/cppcx/crt-functions-not-supported-in-universal-windows-platform-apps.md
+++ b/docs/cppcx/crt-functions-not-supported-in-universal-windows-platform-apps.md
@@ -1,8 +1,7 @@
---
title: "CRT functions not supported in Universal Windows Platform apps"
description: "Reference guide to CRT functions not supported in Universal Windows Platform apps."
-ms.date: "04/16/2020"
-ms.assetid: cbfc957d-6c60-48f4-97e3-1ed8526743b4
+ms.date: 04/16/2020
---
# CRT functions not supported in Universal Windows Platform apps
@@ -47,4 +46,4 @@ Both the previously mentioned APIs and the following APIs are unavailable in Win
|`_chdir` `_wchdir` `_getcwd` `_getdcwd` `_wgetcwd` `_wgetdcwd`|The concept of a working directory doesn't apply to Windows 8.x Store apps.|Use full paths instead.|
|`_isleadbyte_l` `_ismbbalnum`, `_ismbbalnum_l`, `_ismbbalpha`, `_ismbbalpha` `_ismbbalpha_l` `_ismbbgraph` `_ismbbgraph_l` `_ismbbkalnum` `_ismbbkalnum_l` `_ismbbkana` `_ismbbkana_l` `_ismbbkprint` `_ismbbkprint_l` `_ismbbkpunct` `_ismbbkpunct_l` `_ismbblead` `_ismbblead_l` `_ismbbprint` `_ismbbprint_l` `_ismbbpunct` `_ismbbpunct_l` `_ismbbtrail` `_ismbbtrail_l` `_ismbslead` `_ismbslead_l` `_ismbstrail` `_ismbstrail_l` `_mbsdup` `isleadbyte`|Multi-byte strings are not supported in Windows 8.x Store apps.|Use Unicode strings instead.|
|`_tzset`|Environment variables are not available to Windows 8.x Store apps.|No workaround.|
-|`_get_heap_handle`, `_heapmin`|The corresponding Win32 APIs are not supported in Windows 8.x Store apps. And, apps can no longer create private heaps.|No workaround. However, ``_get_heap_handle`` is available in the DEBUG CRT, for debugging purposes only.|
+|`_get_heap_handle`, `_heapmin`|The corresponding Win32 APIs are not supported in Windows 8.x Store apps. And, apps can no longer create private heaps.|No workaround. However, `_get_heap_handle` is available in the DEBUG CRT, for debugging purposes only.|
diff --git a/docs/cppcx/delegates-c-cx.md b/docs/cppcx/delegates-c-cx.md
index af0f96e6d6..3ea53942eb 100644
--- a/docs/cppcx/delegates-c-cx.md
+++ b/docs/cppcx/delegates-c-cx.md
@@ -18,7 +18,7 @@ Delegates are most commonly used in conjunction with events. An event has a dele
event PrimeFoundHandler^ primeFoundEvent;
```
-When declaring delegates that will be exposed to clients across the Windows Runtime application binary interface, use [Windows::Foundation::TypedEventHandler\](/uwp/api/windows.foundation.typedeventhandler-2). This delegate has predefined proxy and stub binaries that enable it to be consumed by Javascript clients.
+When declaring delegates that will be exposed to clients across the Windows Runtime application binary interface, use [Windows::Foundation::TypedEventHandler\](/uwp/api/windows.foundation.typedeventhandler-2). This delegate has predefined proxy and stub binaries that enable it to be consumed by JavaScript clients.
## Consuming delegates
diff --git a/docs/cppcx/deprecating-types-and-members-c-cx.md b/docs/cppcx/deprecating-types-and-members-c-cx.md
index 85471b58e5..8c17a5e3a8 100644
--- a/docs/cppcx/deprecating-types-and-members-c-cx.md
+++ b/docs/cppcx/deprecating-types-and-members-c-cx.md
@@ -1,6 +1,6 @@
---
-description: "Learn more about: Deprecating types and members (C++/CX)"
title: "Deprecating types and members (C++/CX)"
+description: "Learn more about: Deprecating types and members (C++/CX)"
ms.date: 01/07/2022
no-loc: [ "class", "delegate", "enum", "field", "interface", "method", "property", "struct" ]
---
@@ -13,7 +13,7 @@ C++/CX supports deprecation of Windows Runtime types and members for producers a
## Example
-The following example shows how to deprecate your own public APIs—for example, in a Windows Runtime component. The second parameter, of type [`Windows:Foundation::Metadata::DeprecationType`](/uwp/api/windows.foundation.metadata.deprecationtype) specifies whether the API is being deprecated or removed. Currently only the `DeprecationType::Deprecated` value is supported. The third parameter in the attribute specifies the [`Windows::Foundation::Metadata::Platform`](/uwp/api/windows.foundation.metadata.platformattribute) to which the attribute applies.
+The following example shows how to deprecate your own public APIs—for example, in a Windows Runtime component. The second parameter, of type [`Windows::Foundation::Metadata::DeprecationType`](/uwp/api/windows.foundation.metadata.deprecationtype) specifies whether the API is being deprecated or removed. Currently only the `DeprecationType::Deprecated` value is supported. The third parameter in the attribute specifies the [`Windows::Foundation::Metadata::Platform`](/uwp/api/windows.foundation.metadata.platformattribute) to which the attribute applies.
```cpp
namespace wfm = Windows::Foundation::Metadata;
diff --git a/docs/cppcx/fundamental-types-c-cx.md b/docs/cppcx/fundamental-types-c-cx.md
index 4f1bd6c1d8..47155e3cdb 100644
--- a/docs/cppcx/fundamental-types-c-cx.md
+++ b/docs/cppcx/fundamental-types-c-cx.md
@@ -1,12 +1,11 @@
---
-description: "Learn more about: Fundamental types (C++/CX)"
title: "Fundamental types (C++/CX)"
+description: "Learn more about: Fundamental types (C++/CX)"
ms.date: "01/22/2017"
-ms.assetid: c9f82907-25f2-440b-91d6-afb8dbd46ea6
---
# Fundamental types (C++/CX)
-In addition to the standard C++ built-in types, C++/CX supports the type system that's defined by the Windows Runtime architecture by providing typedefs for the Windows Runtime fundamental types that map to standard C++ types.. C++/CX implements Boolean, character, and numeric fundamental types. These typedefs are defined in the `default` namespace, which never needs to be specified explicitly. In addition, C++/CX provides wrappers and concrete implementations for certain Windows Runtime types and interfaces.
+In addition to the standard C++ built-in types, C++/CX supports the type system that's defined by the Windows Runtime architecture by providing typedefs for the Windows Runtime fundamental types that map to standard C++ types. C++/CX implements Boolean, character, and numeric fundamental types. These typedefs are defined in the `default` namespace, which never needs to be specified explicitly. In addition, C++/CX provides wrappers and concrete implementations for certain Windows Runtime types and interfaces.
## Boolean and Character Types
diff --git a/docs/cppcx/platform-accessdeniedexception-class.md b/docs/cppcx/platform-accessdeniedexception-class.md
index bf6cbaed0b..cc50d74596 100644
--- a/docs/cppcx/platform-accessdeniedexception-class.md
+++ b/docs/cppcx/platform-accessdeniedexception-class.md
@@ -1,11 +1,10 @@
---
-description: "Learn more about: Platform::AccessDeniedException Class"
title: "Platform::AccessDeniedException Class"
+description: "Learn more about: Platform::AccessDeniedException Class"
ms.date: "12/30/2016"
ms.topic: "reference"
f1_keywords: ["VCCORLIB/Platform::AccessDeniedException", "VCCORLIB/Platform::AccessDeniedException::AccessDeniedException"]
helpviewer_keywords: ["Platform::AccessDeniedException"]
-ms.assetid: 6ae2155b-7b16-4587-8d2d-da05eab4c7e9
---
# Platform::AccessDeniedException Class
@@ -14,7 +13,7 @@ Thrown when access to a resource or feature is denied.
## Syntax
```cpp
-public ref class AccessDeniedException : COMException, IException, IPrintable, IEquatable
+public ref class AccessDeniedException : COMException, IException, IPrintable, IEquatable
```
### Remarks
diff --git a/docs/cppcx/platform-changedstateexception-class.md b/docs/cppcx/platform-changedstateexception-class.md
index b123e94431..6fc1201500 100644
--- a/docs/cppcx/platform-changedstateexception-class.md
+++ b/docs/cppcx/platform-changedstateexception-class.md
@@ -1,11 +1,10 @@
---
-description: "Learn more about: Platform::ChangedStateException Class"
title: "Platform::ChangedStateException Class"
+description: "Learn more about: Platform::ChangedStateException Class"
ms.date: "12/30/2016"
ms.topic: "reference"
f1_keywords: ["VCCORLIB/Platform::ChangedStateException", "VCCORLIB/Platform::ChangedStateException::ChangedStateException"]
helpviewer_keywords: ["Platform::ChangedStateException"]
-ms.assetid: f894beac-9e80-4fac-ac25-89f1dbc0a6a4
---
# Platform::ChangedStateException Class
@@ -14,7 +13,7 @@ Thrown when the internal state of an object has changed, thereby invalidating th
## Syntax
```cpp
-public ref class ChangedStateException : COMException, IException, IPrintable, IEquatable
+public ref class ChangedStateException : COMException, IException, IPrintable, IEquatable
```
### Remarks
diff --git a/docs/cppcx/platform-classnotregisteredexception-class.md b/docs/cppcx/platform-classnotregisteredexception-class.md
index 9fa2b99397..0108e2bff6 100644
--- a/docs/cppcx/platform-classnotregisteredexception-class.md
+++ b/docs/cppcx/platform-classnotregisteredexception-class.md
@@ -1,11 +1,10 @@
---
-description: "Learn more about: Platform::ClassNotRegisteredException Class"
title: "Platform::ClassNotRegisteredException Class"
+description: "Learn more about: Platform::ClassNotRegisteredException Class"
ms.date: "12/30/2016"
ms.topic: "reference"
f1_keywords: ["VCCORLIB/Platform::ClassNotRegisteredException::ClassNotRegisteredException", "VCCORLIB/Platform::ClassNotRegisteredException"]
helpviewer_keywords: ["Platform::ClassNotRegisteredException"]
-ms.assetid: 8f8871d8-51b9-46e8-902e-ae023c9f1de9
---
# Platform::ClassNotRegisteredException Class
@@ -14,7 +13,7 @@ Thrown when a COM class has not been registered.
## Syntax
```cpp
-public ref class ClassNotRegisteredException : COMException, IException, IPrintable, IEquatable
+public ref class ClassNotRegisteredException : COMException, IException, IPrintable, IEquatable
```
### Remarks
diff --git a/docs/cppcx/platform-collections-map-class.md b/docs/cppcx/platform-collections-map-class.md
index 21b981e5f6..473101cef0 100644
--- a/docs/cppcx/platform-collections-map-class.md
+++ b/docs/cppcx/platform-collections-map-class.md
@@ -1,11 +1,10 @@
---
-description: "Learn more about: Platform::Collections::Map Class"
title: "Platform::Collections::Map Class"
-ms.date: "10/01/2019"
+description: "Learn more about: Platform::Collections::Map Class"
+ms.date: 10/01/2019
ms.topic: "reference"
f1_keywords: ["COLLECTION/Platform::Collections::Map::Map", "COLLECTION/Platform::Collections::Map::Clear", "COLLECTION/Platform::Collections::Map::First", "COLLECTION/Platform::Collections::Map::GetView", "COLLECTION/Platform::Collections::Map::HasKey", "COLLECTION/Platform::Collections::Map::Insert", "COLLECTION/Platform::Collections::Map::Lookup", "COLLECTION/Platform::Collections::Map::Remove", "COLLECTION/Platform::Collections::Map::Size"]
helpviewer_keywords: ["Map Class (C++/Cx)"]
-ms.assetid: 2b8cf968-1167-4898-a149-1195b32c1785
---
# Platform::Collections::Map Class
@@ -206,7 +205,7 @@ Initializes a new instance of the Map class.
```cpp
explicit Map(const C& comp = C());
explicit Map(const StdMap& m);
-explicit Map(StdMap&& m ;
+explicit Map(StdMap&& m);
template
Map(
InItfirst,
diff --git a/docs/cppcx/platform-collections-namespace.md b/docs/cppcx/platform-collections-namespace.md
index f079c117af..1cffd68521 100644
--- a/docs/cppcx/platform-collections-namespace.md
+++ b/docs/cppcx/platform-collections-namespace.md
@@ -9,7 +9,7 @@ ms.assetid: b5042864-5f22-40b7-b7a5-c0691f65cc47
---
# Platform::Collections Namespace
-The Platform::Collections namespace contains the `Map`, `MapView`, `Vector`, and `VectorView` classes. These classes are concrete implementations of the corresponding interfaces that are defined in the [Windows::Foundation::Collections](/uwp/api/windows.foundation.collections) namespace. The concrete collection types are not portable across the ABI (for example when a Javascript or C# program calls into a C++ component), but they are implicitly convertible to their corresponding interface types. For example, if you implement a public method that populates and returns a collection, then use [Platform::Collections::Vector](../cppcx/platform-collections-vector-class.md) to implement the collection internally and use [Windows::Foundation::Collections::IVector](/uwp/api/windows.foundation.collections.ivector-1) as the return type. For more information, see [Collections](../cppcx/collections-c-cx.md) and [Creating Windows Runtime Components in C++](/windows/uwp/winrt-components/creating-windows-runtime-components-in-cpp).
+The Platform::Collections namespace contains the `Map`, `MapView`, `Vector`, and `VectorView` classes. These classes are concrete implementations of the corresponding interfaces that are defined in the [Windows::Foundation::Collections](/uwp/api/windows.foundation.collections) namespace. The concrete collection types are not portable across the ABI (for example when a JavaScript or C# program calls into a C++ component), but they are implicitly convertible to their corresponding interface types. For example, if you implement a public method that populates and returns a collection, then use [Platform::Collections::Vector](../cppcx/platform-collections-vector-class.md) to implement the collection internally and use [Windows::Foundation::Collections::IVector](/uwp/api/windows.foundation.collections.ivector-1) as the return type. For more information, see [Collections](../cppcx/collections-c-cx.md) and [Creating Windows Runtime Components in C++](/windows/uwp/winrt-components/creating-windows-runtime-components-in-cpp).
You can construct a Platform::Collections::Vector from a [std::vector](../standard-library/vector-class.md) and a [Platform::Collections::Map](../cppcx/platform-collections-map-class.md) from a [std::map](../standard-library/map-class.md).
diff --git a/docs/cppcx/platform-comexception-class.md b/docs/cppcx/platform-comexception-class.md
index 5c8363381c..e76f69daed 100644
--- a/docs/cppcx/platform-comexception-class.md
+++ b/docs/cppcx/platform-comexception-class.md
@@ -1,11 +1,10 @@
---
-description: "Learn more about: Platform::COMException Class"
title: "Platform::COMException Class"
+description: "Learn more about: Platform::COMException Class"
ms.date: "12/30/2016"
ms.topic: "reference"
f1_keywords: ["VCCORLIB/Platform::COMException", "VCCORLIB/Platform::COMException::HResult", "VCCORLIB/Platform::COMException::Message"]
helpviewer_keywords: ["Platform::COMException Class"]
-ms.assetid: 44fda4e5-574f-4d12-ab5f-4ff3f277448d
---
# Platform::COMException Class
@@ -14,7 +13,7 @@ Represents COM errors that occur during application execution. COMException is t
## Syntax
```cpp
-public ref class COMException : Exception, IException, IPrintable, IEquatable
+public ref class COMException : Exception, IException, IPrintable, IEquatable
```
### Members
@@ -79,12 +78,12 @@ Intializes a new instance of the COMException class.
### Syntax
```cpp
-COMException( int hresult )
+COMException(int hresult);
```
### Parameters
-*hresult*
+*hresult*\
The error HRESULT that is represented by the exception.
## COMException::HResult Property
@@ -95,7 +94,7 @@ The HRESULT that corresponds to the exception.
```cpp
public:
- property int HResult { int get();}
+ property int HResult { int get(); }
```
## Property Value
@@ -113,7 +112,8 @@ Message that describes the exception.
### Syntax
```cpp
-public:property String^ Message { String^ get();}
+public:
+ property String^ Message { String^ get(); }
```
### Property Value
diff --git a/docs/cppcx/platform-details-heapallocationtrackinglevel-enumeration.md b/docs/cppcx/platform-details-heapallocationtrackinglevel-enumeration.md
index 095d32d623..8e3e645bf9 100644
--- a/docs/cppcx/platform-details-heapallocationtrackinglevel-enumeration.md
+++ b/docs/cppcx/platform-details-heapallocationtrackinglevel-enumeration.md
@@ -1,11 +1,10 @@
---
-description: "Learn more about: Platform::Details::HeapAllocationTrackingLevel Enumeration"
title: "Platform::Details::HeapAllocationTrackingLevel Enumeration"
-ms.date: "12/30/2016"
+description: "Learn more about: Platform::Details::HeapAllocationTrackingLevel Enumeration"
+ms.date: 12/30/2016
ms.topic: "reference"
f1_keywords: ["VCCORLIB/Platform::Details::HeapAllocationTrackingLevel"]
helpviewer_keywords: ["Platform::Details::HeapAllocationTrackingLevel Enumeration"]
-ms.assetid: dc341bc0-b47b-4eb2-9445-fbaf788e7b1a
---
# Platform::Details::HeapAllocationTrackingLevel Enumeration
@@ -14,7 +13,7 @@ This enumeration is intended for internal use only, and is not intended to be us
## Syntax
```cpp
-enumm class HeapAllocationTrackingLevel;
+enum class HeapAllocationTrackingLevel;
```
### Remarks
diff --git a/docs/cppcx/platform-disconnectedexception-class.md b/docs/cppcx/platform-disconnectedexception-class.md
index 332d47be88..5721f44c9a 100644
--- a/docs/cppcx/platform-disconnectedexception-class.md
+++ b/docs/cppcx/platform-disconnectedexception-class.md
@@ -1,20 +1,19 @@
---
-description: "Learn more about: Platform::DisconnectedException Class"
title: "Platform::DisconnectedException Class"
+description: "Learn more about: Platform::DisconnectedException Class"
ms.date: "12/30/2016"
ms.topic: "reference"
f1_keywords: ["VCCORLIB/Platform::DisconnectedException", "VCCORLIB/Platform::DisconnectedException::DisconnectedException"]
helpviewer_keywords: ["Platform::DisconnectedException"]
-ms.assetid: c25e0d64-5bff-4c21-88e5-c4ec2776fa7f
---
# Platform::DisconnectedException Class
-Thrown when a COM proxy object attempts to reference a COM server that no longer exists
+Thrown when a COM proxy object attempts to reference a COM server that no longer exists.
## Syntax
-```
-public ref class DisconnectedException : COMException, IException, IPrintable, IEquatable
+```cpp
+public ref class DisconnectedException : COMException, IException, IPrintable, IEquatable
```
### Remarks
diff --git a/docs/cppcx/platform-exception-class.md b/docs/cppcx/platform-exception-class.md
index 69631f3d54..4eb7e70d3d 100644
--- a/docs/cppcx/platform-exception-class.md
+++ b/docs/cppcx/platform-exception-class.md
@@ -1,11 +1,10 @@
---
-description: "Learn more about: Platform::Exception Class"
title: "Platform::Exception Class"
+description: "Learn more about: Platform::Exception Class"
ms.date: "12/30/2016"
ms.topic: "reference"
f1_keywords: ["VCCORLIB/Platform::Exception::Exception", "VCCORLIB/Platform::Exception::CreateException", "VCCORLIB/Platform::Exception::HResult", "VCCORLIB/Platform::Exception::Message"]
helpviewer_keywords: ["Platform::Exception Class"]
-ms.assetid: ca1d5a67-3a5a-48fe-8099-f9c38a2d2dce
---
# Platform::Exception Class
@@ -14,7 +13,7 @@ Represents errors that occur during application execution. Custom exception clas
## Syntax
```cpp
-public ref class Exception : Object, IException, IPrintable, IEquatable
+public ref class Exception : Object, IException, IPrintable, IEquatable
```
### Members
@@ -31,7 +30,7 @@ The `Exception` class also has the following kinds of members.
### Methods
-The `Exception` class inherits the `Equals()`, `Finalize()`,`GetHashCode()`,`GetType()`,`MemberwiseClose()`, and `ToString()` methods from the [Platform::Object Class](../cppcx/platform-object-class.md). The `Exception` class also has the following method.
+The `Exception` class inherits the `Equals()`, `Finalize()`, `GetHashCode()`, `GetType()`, `MemberwiseClose()`, and `ToString()` methods from the [Platform::Object Class](../cppcx/platform-object-class.md). The `Exception` class also has the following method.
|Member|Description|
|------------|-----------------|
@@ -69,10 +68,10 @@ Exception^ CreateException(int32 hr, Platform::String^ message);
### Parameters
-*hr*
+*hr*\
An HRESULT value that you typically get from a call to a COM method. If the value is 0, which is equal to S_OK, this method throws [Platform::InvalidArgumentException](../cppcx/platform-invalidargumentexception-class.md) because COM methods that succeed should not throw exceptions.
-*message*
+*message*\
A string that describes the error.
### Return Value
@@ -98,10 +97,10 @@ Exception(int32 hresult, ::Platform::String^ message);
### Parameters
-*hresult*
+*hresult*\
The error HRESULT that is represented by the exception.
-*message*
+*message*\
A user-specified message, such as prescriptive text, that is associated with the exception. In general you should prefer the second overload in order to provide a descriptive message that is as specific as possible about how and why the error has occurred.
## Exception::HResult Property
@@ -130,7 +129,8 @@ Message that describes the error.
### Syntax
```cpp
-public:property String^ Message;
+public:
+ property String^ Message;
```
### Property Value
diff --git a/docs/cppcx/platform-failureexception-class.md b/docs/cppcx/platform-failureexception-class.md
index 02f7ca1cfb..24268a74b3 100644
--- a/docs/cppcx/platform-failureexception-class.md
+++ b/docs/cppcx/platform-failureexception-class.md
@@ -1,11 +1,10 @@
---
-description: "Learn more about: Platform::FailureException Class"
title: "Platform::FailureException Class"
+description: "Learn more about: Platform::FailureException Class"
ms.date: "12/30/2016"
ms.topic: "reference"
f1_keywords: ["VCCORLIB/Platform::FailureException::FailureException", "VCCORLIB/Platform::FailureException"]
helpviewer_keywords: ["Platform::FailureException"]
-ms.assetid: 1729cd07-bfc2-448e-9db5-185d5cbf5b81
---
# Platform::FailureException Class
@@ -14,7 +13,7 @@ Thrown when the operation has failed. It is the equivalent of the E_FAIL HRESULT
## Syntax
```cpp
-public ref class FailureException : COMException, IException, IPrintable, IEquatable
+public ref class FailureException : COMException, IException, IPrintable, IEquatable
```
### Remarks
diff --git a/docs/cppcx/platform-guid-value-class.md b/docs/cppcx/platform-guid-value-class.md
index 952645712c..825700de85 100644
--- a/docs/cppcx/platform-guid-value-class.md
+++ b/docs/cppcx/platform-guid-value-class.md
@@ -1,15 +1,14 @@
---
-description: "Learn more about: Platform::Guid value class"
title: "Platform::Guid value class"
+description: "Learn more about: Platform::Guid value class"
ms.date: "01/15/2019"
ms.topic: "reference"
f1_keywords: ["VCCORLIB/Platform::Guid"]
helpviewer_keywords: ["Platform::Guid Struct"]
-ms.assetid: 25c0bfb2-7f93-44d8-bdf4-ef4fbac3424a
---
# Platform::Guid value class
-Represents a [GUID](/windows/win32/api/guiddef/ns-guiddef-guid type in the Windows Runtime type system.
+Represents a [GUID](/windows/win32/api/guiddef/ns-guiddef-guid) type in the Windows Runtime type system.
## Syntax
@@ -74,43 +73,43 @@ Guid(
### Parameters
-*a*
+*a*\
The first 4 bytes of the `GUID`.
-*b*
+*b*\
The next 2 bytes of the `GUID`.
-*c*
+*c*\
The next 2 bytes of the `GUID`.
-*d*
+*d*\
The next byte of the `GUID`.
-*e*
+*e*\
The next byte of the `GUID`.
-*f*
+*f*\
The next byte of the `GUID`.
-*g*
+*g*\
The next byte of the `GUID`.
-*h*
+*h*\
The next byte of the `GUID`.
-*i*
+*i*\
The next byte of the `GUID`.
-*j*
+*j*\
The next byte of the `GUID`.
-*k*
+*k*\
The next byte of the `GUID`.
-*m*
+*m*\
A `GUID` in the form a [GUID structure](/windows/win32/api/guiddef/ns-guiddef-guid).
-*n*
+*n*\
The remaining 8 bytes of the `GUID`.
## Guid::operator== Operator
@@ -125,10 +124,10 @@ static bool Platform::Guid::operator==(Platform::Guid guid1, Platform::Guid guid
### Parameters
-*guid1*
+*guid1*\
The first `Platform::Guid` to compare.
-*guid2*
+*guid2*\
The second `Platform::Guid` to compare.
### Return Value
@@ -152,10 +151,10 @@ static bool Platform::Guid::operator!=(Platform::Guid guid1, Platform::Guid guid
### Parameters
-*guid1*
+*guid1*\
The first `Platform::Guid` to compare.
-*guid2*
+*guid2*\
The second `Platform::Guid` to compare.
### Return Value
@@ -174,10 +173,10 @@ static bool Platform::Guid::operator<(Platform::Guid guid1, Platform::Guid guid2
### Parameters
-*guid1*
+*guid1*\
The first `Platform::Guid` to compare.
-*guid2*
+*guid2*\
The second `Platform::Guid` to compare.
### Return Value
diff --git a/docs/cppcx/platform-intptr-value-class.md b/docs/cppcx/platform-intptr-value-class.md
index de08c207cf..b08b50209b 100644
--- a/docs/cppcx/platform-intptr-value-class.md
+++ b/docs/cppcx/platform-intptr-value-class.md
@@ -1,11 +1,10 @@
---
-description: "Learn more about: Platform::IntPtr value class"
title: "Platform::IntPtr value class"
+description: "Learn more about: Platform::IntPtr value class"
ms.date: "12/30/2016"
ms.topic: "reference"
f1_keywords: ["VCCORLIB/PlatformIntPtr::IntPtr", "VCCORLIB/PlatformIntPtr::op_explicit Operator", "VCCORLIB/PlatformIntPtr::ToInt32"]
helpviewer_keywords: ["Platform::IntPtr Struct"]
-ms.assetid: 6c0326e8-edfd-4e53-a963-240b845dcde8
---
# Platform::IntPtr value class
@@ -37,7 +36,7 @@ IntPtr has the following members:
**Metadata:** platform.winmd
-## IntPtr::IntPtr Constructor
+## IntPtr::IntPtr Constructor
Initializes a new instance of an IntPtr with the specified value.
@@ -52,7 +51,7 @@ IntPtr( __int64 handle-or-pointer ); IntPtr( void* value ); IntPtr( int 32-b
*value*
A 64-bit handle or pointer, or a pointer to a 64-bit value, or a 32-bit value that can be converted to a 64-bit value.
-## IntPtr::op_explicit Operator
+## IntPtr::op_explicit Operator
Converts the specified parameter to an IntPtr or a pointer to an IntPtr value.
@@ -77,7 +76,7 @@ An IntPtr.
The first and second operators return an IntPtr. The third operator returns a pointer to the value represented by the current IntPtr.
-## IntPtr::ToInt32 Method
+## IntPtr::ToInt32 Method
Converts the current IntPtr value to a 32-bit integer.
diff --git a/docs/cppcx/platform-invalidargumentexception-class.md b/docs/cppcx/platform-invalidargumentexception-class.md
index 120bdd9d5c..040d608c66 100644
--- a/docs/cppcx/platform-invalidargumentexception-class.md
+++ b/docs/cppcx/platform-invalidargumentexception-class.md
@@ -1,11 +1,10 @@
---
-description: "Learn more about: Platform::InvalidArgumentException Class"
title: "Platform::InvalidArgumentException Class"
+description: "Learn more about: Platform::InvalidArgumentException Class"
ms.date: "12/30/2016"
ms.topic: "reference"
f1_keywords: ["VCCORLIB/Platform::InvalidArgumentException", "VCCORLIB/Platform::InvalidArgumentException::InvalidArgumentException"]
helpviewer_keywords: ["Platform::InvalidArgumentException"]
-ms.assetid: 1a8d860b-3bcb-41a9-9346-6610616a0b46
---
# Platform::InvalidArgumentException Class
@@ -14,7 +13,7 @@ Thrown when one of the arguments provided to a method is not valid.
## Syntax
```cpp
-public ref class InvalidArgumentException : COMException, IException, IPrintable, IEquatable
+public ref class InvalidArgumentException : COMException, IException, IPrintable, IEquatable
```
### Remarks
diff --git a/docs/cppcx/platform-invalidcastexception-class.md b/docs/cppcx/platform-invalidcastexception-class.md
index 4f9b3c4ba7..9e664b598b 100644
--- a/docs/cppcx/platform-invalidcastexception-class.md
+++ b/docs/cppcx/platform-invalidcastexception-class.md
@@ -1,11 +1,10 @@
---
-description: "Learn more about: Platform::InvalidCastException Class"
title: "Platform::InvalidCastException Class"
+description: "Learn more about: Platform::InvalidCastException Class"
ms.date: "12/30/2016"
ms.topic: "reference"
f1_keywords: ["VCCORLIB/Platform::InvalidCastException::InvalidCastException", "VCCORLIB/Platform::InvalidCastException"]
helpviewer_keywords: ["Platform::InvalidCastException"]
-ms.assetid: 0215131d-1251-4913-9561-824410e045b6
---
# Platform::InvalidCastException Class
@@ -14,7 +13,7 @@ Thrown when a cast or explicit conversion is invalid.
## Syntax
```cpp
-public ref class InvalidCastException : COMException, IException, IPrintable, IEquatable
+public ref class InvalidCastException : COMException, IException, IPrintable, IEquatable
```
### Remarks
diff --git a/docs/cppcx/platform-metadata-runtimeclassname.md b/docs/cppcx/platform-metadata-runtimeclassname.md
index d40541dd80..e7e5d3a056 100644
--- a/docs/cppcx/platform-metadata-runtimeclassname.md
+++ b/docs/cppcx/platform-metadata-runtimeclassname.md
@@ -1,15 +1,14 @@
---
-description: "Learn more about: Platform::Metadata::RuntimeClassName"
title: "Platform::Metadata::RuntimeClassName"
+description: "Learn more about: Platform::Metadata::RuntimeClassName"
ms.date: "12/30/2016"
ms.topic: "reference"
f1_keywords: ["VCCORLIB/Platform::Metadata::RuntimeClassName"]
helpviewer_keywords: ["RuntimeClassName", "Platform::Metadata::RuntimeClassName"]
-ms.assetid: fdef8f85-ab94-4edd-ba50-ee0da9358ff6
---
# Platform::Metadata::RuntimeClassName
-When applied to a class definition, ensures that a private class returns a valid name from the GetRuntimeClassName function..
+When applied to a class definition, ensures that a private class returns a valid name from the GetRuntimeClassName function.
## Syntax
diff --git a/docs/cppcx/platform-notimplementedexception-class.md b/docs/cppcx/platform-notimplementedexception-class.md
index 55e18d0b57..94f1c289d8 100644
--- a/docs/cppcx/platform-notimplementedexception-class.md
+++ b/docs/cppcx/platform-notimplementedexception-class.md
@@ -1,11 +1,10 @@
---
-description: "Learn more about: Platform::NotImplementedException Class"
title: "Platform::NotImplementedException Class"
+description: "Learn more about: Platform::NotImplementedException Class"
ms.date: "12/30/2016"
ms.topic: "reference"
f1_keywords: ["VCCORLIB/Platform::NotImplementedException", "VCCORLIB/Platform::NotImplementedException::NotImplementedException"]
helpviewer_keywords: ["Platform::NotImplementedException"]
-ms.assetid: 6da26cc2-dde8-4aea-aa85-67aac55cf97b
---
# Platform::NotImplementedException Class
@@ -14,7 +13,7 @@ Thrown when an interface member is not been implemented in a derived type.
## Syntax
```cpp
-public ref class NotImplementedException : COMException, IException, IPrintable, IEquatable
+public ref class NotImplementedException : COMException, IException, IPrintable, IEquatable
```
### Remarks
diff --git a/docs/cppcx/platform-nullreferenceexception-class.md b/docs/cppcx/platform-nullreferenceexception-class.md
index c5924402c2..4fd3153854 100644
--- a/docs/cppcx/platform-nullreferenceexception-class.md
+++ b/docs/cppcx/platform-nullreferenceexception-class.md
@@ -1,11 +1,10 @@
---
-description: "Learn more about: Platform::NullReferenceException Class"
title: "Platform::NullReferenceException Class"
+description: "Learn more about: Platform::NullReferenceException Class"
ms.date: "12/30/2016"
ms.topic: "reference"
f1_keywords: ["VCCORLIB/Platform::NullReferenceException", "VCCORLIB/Platform::NullReferenceException::NullReferenceException"]
helpviewer_keywords: ["Platform::NullReferenceException"]
-ms.assetid: be202577-d898-4716-83cd-e3556fe8a241
---
# Platform::NullReferenceException Class
@@ -14,7 +13,7 @@ Thrown when there is an attempt to dereference a null object reference.
## Syntax
```cpp
-public ref class NullReferenceException : COMException, IException, IPrintable, IEquatable
+public ref class NullReferenceException : COMException, IException, IPrintable, IEquatable
```
### Remarks
diff --git a/docs/cppcx/platform-object-class.md b/docs/cppcx/platform-object-class.md
index eb270ad593..3964399163 100644
--- a/docs/cppcx/platform-object-class.md
+++ b/docs/cppcx/platform-object-class.md
@@ -1,11 +1,10 @@
---
-description: "Learn more about: Platform::Object Class"
title: "Platform::Object Class"
+description: "Learn more about: Platform::Object Class"
ms.date: "12/30/2016"
ms.topic: "reference"
f1_keywords: ["VCCORLIB/Platform::Object::Object", "VCCORLIB/Platform::Object::Equals", "VCCORLIB/Platform::Object::GetHashCode", "VCCORLIB/Platform::Object::ReferenceEquals", "VCCORLIB/Platform::ToString", "VCCORLIB/Platform::GetType"]
helpviewer_keywords: ["Object class"]
-ms.assetid: 709e84a8-0bff-471b-bc14-63e424080b5a
---
# Platform::Object Class
@@ -104,7 +103,7 @@ A [Platform::Type](../cppcx/platform-type-class.md) object that describes the ru
The static [Type::GetTypeCode](../cppcx/platform-type-class.md#gettypecode) can be used to get a [Platform::TypeCode Enumeration](../cppcx/platform-typecode-enumeration.md) value that represents the current type. This is mostly useful for built-in types. The type code for any ref class besides [Platform::String](../cppcx/platform-string-class.md) is Object (1).
-The [Windows::UI::Xaml::Interop::TypeName](/uwp/api/windows.ui.xaml.interop.typename) class is used in the Windows APIs as a language-independent way of passing type information between Windows components and apps. The T[Platform::Type Class](../cppcx/platform-type-class.md) has operators for converting between `Type` and `TypeName`.
+The [Windows::UI::Xaml::Interop::TypeName](/uwp/api/windows.ui.xaml.interop.typename) class is used in the Windows APIs as a language-independent way of passing type information between Windows components and apps. The [Platform::Type Class](../cppcx/platform-type-class.md) has operators for converting between `Type` and `TypeName`.
Use the [typeid](../extensions/typeid-cpp-component-extensions.md) operator to return a `Platform::Type` object for a class name, for example when navigating between XAML pages:
@@ -173,6 +172,6 @@ public:
## See also
-[Platform Namespace](platform-namespace-c-cx.md)
-[Platform::Type Class](platform-type-class.md)
+[Platform Namespace](platform-namespace-c-cx.md)\
+[Platform::Type Class](platform-type-class.md)\
[Type System](type-system-c-cx.md)
diff --git a/docs/cppcx/platform-objectdisposedexception-class.md b/docs/cppcx/platform-objectdisposedexception-class.md
index 36f7004267..0d9a905551 100644
--- a/docs/cppcx/platform-objectdisposedexception-class.md
+++ b/docs/cppcx/platform-objectdisposedexception-class.md
@@ -1,11 +1,10 @@
---
-description: "Learn more about: Platform::ObjectDisposedException Class"
title: "Platform::ObjectDisposedException Class"
+description: "Learn more about: Platform::ObjectDisposedException Class"
ms.date: "12/30/2016"
ms.topic: "reference"
f1_keywords: ["VCCORLIB/Platform::ObjectDisposedException", "VCCORLIB/Platform::ObjectDisposedException::ObjectDisposedException"]
helpviewer_keywords: ["Platform::ObjectDisposedException"]
-ms.assetid: 68506fe4-d09c-4407-999f-1e3edb261d41
---
# Platform::ObjectDisposedException Class
@@ -14,7 +13,7 @@ Thrown when an operation is performed on a disposed object.
## Syntax
```cpp
-public ref class ObjectDisposedException : COMException, IException, IPrintable, IEquatable
+public ref class ObjectDisposedException : COMException, IException, IPrintable, IEquatable
```
### Remarks
diff --git a/docs/cppcx/platform-operationcanceledexception-class.md b/docs/cppcx/platform-operationcanceledexception-class.md
index 0ada6f4496..99ce0bc558 100644
--- a/docs/cppcx/platform-operationcanceledexception-class.md
+++ b/docs/cppcx/platform-operationcanceledexception-class.md
@@ -1,11 +1,10 @@
---
-description: "Learn more about: Platform::OperationCanceledException Class"
title: "Platform::OperationCanceledException Class"
+description: "Learn more about: Platform::OperationCanceledException Class"
ms.date: "12/30/2016"
ms.topic: "reference"
f1_keywords: ["VCCORLIB/Platform::OperationCanceledException::OperationCanceledException", "VCCORLIB/Platform::OperationCanceledException"]
helpviewer_keywords: ["Platform::OperationCanceledException"]
-ms.assetid: 5351bc20-5408-423a-8169-f09acc8a3fbb
---
# Platform::OperationCanceledException Class
@@ -14,7 +13,7 @@ Thrown when an operation is aborted.
## Syntax
```cpp
-public ref class OperationCanceledException : COMException, IException, IPrintable, IEquatable
+public ref class OperationCanceledException : COMException, IException, IPrintable, IEquatable
```
### Remarks
diff --git a/docs/cppcx/platform-outofboundsexception-class.md b/docs/cppcx/platform-outofboundsexception-class.md
index d8a878c891..2bca3dbbac 100644
--- a/docs/cppcx/platform-outofboundsexception-class.md
+++ b/docs/cppcx/platform-outofboundsexception-class.md
@@ -1,11 +1,10 @@
---
-description: "Learn more about: Platform::OutOfBoundsException Class"
title: "Platform::OutOfBoundsException Class"
+description: "Learn more about: Platform::OutOfBoundsException Class"
ms.date: "12/30/2016"
ms.topic: "reference"
f1_keywords: ["VCCORLIB/Platform::OutOfBoundsException", "VCCORLIB/Platform::OutOfBoundsException::OutOfBoundsException"]
helpviewer_keywords: ["Platform::OutOfBoundsException"]
-ms.assetid: 96f8bf75-1207-4049-964b-7771822cadf3
---
# Platform::OutOfBoundsException Class
@@ -14,7 +13,7 @@ Thrown when an operation attempts to access data outside the valid range.
## Syntax
```cpp
-public ref class OutOfBoundsException : COMException, IException, IPrintable, IEquatable
+public ref class OutOfBoundsException : COMException, IException, IPrintable, IEquatable
```
### Remarks
diff --git a/docs/cppcx/platform-outofmemoryexception-class.md b/docs/cppcx/platform-outofmemoryexception-class.md
index bf36a9f791..486396cf6a 100644
--- a/docs/cppcx/platform-outofmemoryexception-class.md
+++ b/docs/cppcx/platform-outofmemoryexception-class.md
@@ -1,11 +1,10 @@
---
-description: "Learn more about: Platform::OutOfMemoryException Class"
title: "Platform::OutOfMemoryException Class"
+description: "Learn more about: Platform::OutOfMemoryException Class"
ms.date: "12/30/2016"
ms.topic: "reference"
f1_keywords: ["VCCORLIB/Platform::OutOfMemoryException", "VCCORLIB/Platform::OutOfMemoryException::OutOfMemoryException"]
helpviewer_keywords: ["Platform::OutOfMemoryException"]
-ms.assetid: 49c19f6b-f66c-4448-b861-91dcbf32de2c
---
# Platform::OutOfMemoryException Class
@@ -14,7 +13,7 @@ Thrown when there's insufficient memory to complete the operation.
## Syntax
```cpp
-public ref class OutOfMemoryException : COMException, IException, IPrintable, IEquatable
+public ref class OutOfMemoryException : COMException, IException, IPrintable, IEquatable
```
### Remarks
diff --git a/docs/cppcx/platform-wrongthreadexception-class.md b/docs/cppcx/platform-wrongthreadexception-class.md
index 79320770d5..33c5039914 100644
--- a/docs/cppcx/platform-wrongthreadexception-class.md
+++ b/docs/cppcx/platform-wrongthreadexception-class.md
@@ -1,11 +1,10 @@
---
-description: "Learn more about: Platform::WrongThreadException Class"
title: "Platform::WrongThreadException Class"
+description: "Learn more about: Platform::WrongThreadException Class"
ms.date: "12/30/2016"
ms.topic: "reference"
f1_keywords: ["VCCORLIB/Platform::WrongThreadException", "VCCORLIB/Platform::WrongThreadException::WrongThreadException"]
helpviewer_keywords: ["Platform::WrongThreadException"]
-ms.assetid: c193f97e-0392-4535-a4c4-0711e4e4a836
---
# Platform::WrongThreadException Class
@@ -14,7 +13,7 @@ Thrown when a thread calls by way of an interface pointer for a proxy object tha
## Syntax
```cpp
-public ref class WrongThreadException : COMException, IException, IPrintable, IEquatable
+public ref class WrongThreadException : COMException, IException, IPrintable, IEquatable
```
### Remarks
diff --git a/docs/cppcx/value-classes-and-structs-c-cx.md b/docs/cppcx/value-classes-and-structs-c-cx.md
index 4c4cd2cdc8..55d9691754 100644
--- a/docs/cppcx/value-classes-and-structs-c-cx.md
+++ b/docs/cppcx/value-classes-and-structs-c-cx.md
@@ -1,9 +1,8 @@
---
-description: "Learn more about: Value classes and structs (C++/CX)"
title: "Value classes and structs (C++/CX)"
+description: "Learn more about: Value classes and structs (C++/CX)"
ms.date: "12/30/2016"
helpviewer_keywords: ["value struct", "value class"]
-ms.assetid: 262a0992-9721-4c02-8297-efc07d90e5a4
---
# Value classes and structs (C++/CX)
@@ -48,7 +47,7 @@ A value struct or value class can contain as fields only fundamental numeric typ
A value class or value struct that contains a `Platform::String^` or `IBox^` type as a member is not `memcpy`-able.
-Because all members of a **`value class`** or **`value struct`** are public and are emitted into metadata, standard C++ types are not allowed as members. This is different from ref classes, which may contain **`private`** or **`internal`** standard C++ types..
+Because all members of a **`value class`** or **`value struct`** are public and are emitted into metadata, standard C++ types are not allowed as members. This is different from ref classes, which may contain **`private`** or **`internal`** standard C++ types.
The following code fragment declares the `Coordinates` and `City` types as value structs. Notice that one of the `City` data members is a `GeoCoordinates` type. A **`value struct`** can contain other value structs as members.
@@ -140,7 +139,7 @@ public:
## See also
-[Type System (C++/CX)](../cppcx/type-system-c-cx.md)
-[C++/CX Language Reference](../cppcx/visual-c-language-reference-c-cx.md)
-[Namespaces Reference](../cppcx/namespaces-reference-c-cx.md)
+[Type System (C++/CX)](../cppcx/type-system-c-cx.md)\
+[C++/CX Language Reference](../cppcx/visual-c-language-reference-c-cx.md)\
+[Namespaces Reference](../cppcx/namespaces-reference-c-cx.md)\
[Ref classes and structs (C++/CX)](../cppcx/ref-classes-and-structs-c-cx.md)
diff --git a/docs/cppcx/wrl/module-class.md b/docs/cppcx/wrl/module-class.md
index e228f5e864..3cefc4e6d7 100644
--- a/docs/cppcx/wrl/module-class.md
+++ b/docs/cppcx/wrl/module-class.md
@@ -1,11 +1,10 @@
---
-description: "Learn more about: Module Class"
title: "Module Class"
-ms.date: "10/18/2018"
+description: "Learn more about: Module Class"
+ms.date: 10/18/2018
ms.topic: "reference"
f1_keywords: ["module/Microsoft::WRL::Module", "module/Microsoft::WRL::Module::Create", "module/Microsoft::WRL::Module::DecrementObjectCount", "module/Microsoft::WRL::Module::GetActivationFactory", "module/Microsoft::WRL::Module::GetClassObject", "module/Microsoft::WRL::Module::GetModule", "module/Microsoft::WRL::Module::GetObjectCount", "module/Microsoft::WRL::Module::IncrementObjectCount", "module/Microsoft::WRL::Module::Module", "module/Microsoft::WRL::Module::objectCount_Data", "module/Microsoft::WRL::Module::RegisterCOMObject", "module/Microsoft::WRL::Module::RegisterObjects", "module/Microsoft::WRL::Module::RegisterWinRTObject", "module/Microsoft::WRL::Module::releaseNotifier_", "module/Microsoft::WRL::Module::Terminate", "module/Microsoft::WRL::Module::~Module", "module/Microsoft::WRL::Module::UnregisterCOMObject", "module/Microsoft::WRL::Module::UnregisterObjects", "module/Microsoft::WRL::Module::UnregisterWinRTObject"]
helpviewer_keywords: ["Microsoft::WRL::Module class", "Microsoft::WRL::Module::Create method", "Microsoft::WRL::Module::DecrementObjectCount method", "Microsoft::WRL::Module::GetActivationFactory method", "Microsoft::WRL::Module::GetClassObject method", "Microsoft::WRL::Module::GetModule method", "Microsoft::WRL::Module::GetObjectCount method", "Microsoft::WRL::Module::IncrementObjectCount method", "Microsoft::WRL::Module::Module, constructor", "Microsoft::WRL::Module::objectCount_ data member", "Microsoft::WRL::Module::RegisterCOMObject method", "Microsoft::WRL::Module::RegisterObjects method", "Microsoft::WRL::Module::RegisterWinRTObject method", "Microsoft::WRL::Module::releaseNotifier_ data member", "Microsoft::WRL::Module::Terminate method", "Microsoft::WRL::Module::~Module, destructor", "Microsoft::WRL::Module::UnregisterCOMObject method", "Microsoft::WRL::Module::UnregisterObjects method", "Microsoft::WRL::Module::UnregisterWinRTObject method"]
-ms.assetid: dd67e3b8-c2e1-4f53-8c0f-565a140ba649
---
# Module Class
@@ -396,7 +395,7 @@ Unregisters one or more COM objects, which prevents other applications from conn
virtual HRESULT UnregisterCOMObject(
const wchar_t* serverName,
DWORD* cookies,
- unsigned int count
+ unsigned int count);
```
### Parameters
diff --git a/docs/cppcx/wrl/walkthrough-creating-a-windows-store-app-using-wrl-and-media-foundation.md b/docs/cppcx/wrl/walkthrough-creating-a-windows-store-app-using-wrl-and-media-foundation.md
index a4f29be142..5ec81ffc80 100644
--- a/docs/cppcx/wrl/walkthrough-creating-a-windows-store-app-using-wrl-and-media-foundation.md
+++ b/docs/cppcx/wrl/walkthrough-creating-a-windows-store-app-using-wrl-and-media-foundation.md
@@ -1,6 +1,6 @@
---
-description: "Learn more about: Creating a UWP app using WRL and Media Foundation"
title: "Walkthrough: Creating a UWP app using WRL and Media Foundation"
+description: "Learn more about: Creating a UWP app using WRL and Media Foundation"
ms.date: 04/15/2021
ms.topic: "reference"
---
@@ -37,7 +37,7 @@ You can usually use C++/CX to create Windows Runtime components. However, someti
- The `namespace` and `runtimeclass` attributes, and the `NTDDI_WIN8` [version](/windows/win32/Midl/version) attribute value are important parts of the MIDL definition for a Media Foundation component that uses WRL.
-- [`Microsoft::WRL::RuntimeClass`](runtimeclass-class.md) is the base class for the custom Media Foundation component. The [`Microsoft::WRL::RuntimeClassType::WinRtClassicComMix]`(runtimeclasstype-enumeration.md) enum value, which is provided as a template argument, marks the class for use both as a Windows Runtime class and as a classic COM runtime class.
+- [`Microsoft::WRL::RuntimeClass`](runtimeclass-class.md) is the base class for the custom Media Foundation component. The [`Microsoft::WRL::RuntimeClassType::WinRtClassicComMix`](runtimeclasstype-enumeration.md) enum value, which is provided as a template argument, marks the class for use both as a Windows Runtime class and as a classic COM runtime class.
- The [`InspectableClass`](inspectableclass-macro.md) macro implements basic COM functionality such as reference counting and the `QueryInterface` method, and sets the runtime class name and trust level.
diff --git a/docs/cross-platform/build-an-opengl-es-application-on-android-and-ios.md b/docs/cross-platform/build-an-opengl-es-application-on-android-and-ios.md
index 43deedc3b7..bb6cc8a0cd 100644
--- a/docs/cross-platform/build-an-opengl-es-application-on-android-and-ios.md
+++ b/docs/cross-platform/build-an-opengl-es-application-on-android-and-ios.md
@@ -21,7 +21,7 @@ To build and test the iOS app, you'll need a Mac computer. Set it up according t
## Create a new OpenGLES Application project
-In this tutorial, you first create a new OpenGL ES Application project. and then build and run the default app in an Android emulator. Next you build the app for iOS and run the app on an iOS device.
+In this tutorial, you first create a new OpenGL ES Application project and then build and run it in an Android emulator. Next you build the app for iOS and run the app on an iOS device.
::: moniker range="msvc-150"
@@ -53,7 +53,7 @@ In this tutorial, you first create a new OpenGL ES Application project. and then
::: moniker-end
-The new OpenGL ES Application solution includes three library projects and two application projects. The Libraries folder includes a shared code project. And, two platform-specific projects that reference the shared code:
+The new OpenGL ES Application solution includes three library projects and two application projects. The Libraries folder includes a shared code project, and two platform-specific projects that reference the shared code:
- `MyOpenGLESApp.Android.NativeActivity` contains the references and glue code that implements your app as a Native Activity on Android. The entry points from the glue code are implemented in *main.cpp*, which includes the common shared code in `MyOpenGLESApp.Shared`. Precompiled headers are in *pch.h*. This Native Activity app project is compiled into a shared library (*.so*) file, which is picked up by the `MyOpenGLESApp.Android.Packaging` project.
diff --git a/docs/cross-platform/media/cppmdd-options-ios-new.png b/docs/cross-platform/media/cppmdd-options-ios-new.png
index de5661cf55..4a79c5d200 100644
Binary files a/docs/cross-platform/media/cppmdd-options-ios-new.png and b/docs/cross-platform/media/cppmdd-options-ios-new.png differ
diff --git a/docs/data/changes-you-might-make-to-the-default-code-mfc-data-access.md b/docs/data/changes-you-might-make-to-the-default-code-mfc-data-access.md
index e2555def69..d524c7ae40 100644
--- a/docs/data/changes-you-might-make-to-the-default-code-mfc-data-access.md
+++ b/docs/data/changes-you-might-make-to-the-default-code-mfc-data-access.md
@@ -1,9 +1,8 @@
---
-description: "Learn more about: Changes You Might Make to the Default Code (MFC Data Access)"
title: "Changes You Might Make to the Default Code (MFC Data Access)"
+description: "Learn more about: Changes You Might Make to the Default Code (MFC Data Access)"
ms.date: "11/04/2016"
helpviewer_keywords: ["record views [C++], customizing default code"]
-ms.assetid: 9992ed37-a6bf-45a5-a572-5c14e42b6628
---
# Changes You Might Make to the Default Code (MFC Data Access)
@@ -13,7 +12,7 @@ The [MFC Application Wizard](../mfc/reference/database-support-mfc-application-w
- Parameterize the recordset. Specify the actual run-time parameter value after the filter. For more information, see [Recordset: Parameterizing a Recordset (ODBC)](../data/odbc/recordset-parameterizing-a-recordset-odbc.md)
-- Pass a customized SQL string to the [Open](../mfc/reference/crecordset-class.md#open) member function. For a discussion of what you can accomplish with this technique , see [SQL: Customizing Your Recordset's SQL Statement (ODBC)](../data/odbc/sql-customizing-your-recordsets-sql-statement-odbc.md).
+- Pass a customized SQL string to the [Open](../mfc/reference/crecordset-class.md#open) member function. For a discussion of what you can accomplish with this technique, see [SQL: Customizing Your Recordset's SQL Statement (ODBC)](../data/odbc/sql-customizing-your-recordsets-sql-statement-odbc.md).
## See also
diff --git a/docs/data/data-access-in-cpp.md b/docs/data/data-access-in-cpp.md
index 9ac4a72755..30bf416352 100644
--- a/docs/data/data-access-in-cpp.md
+++ b/docs/data/data-access-in-cpp.md
@@ -31,7 +31,7 @@ Connect to Azure SQL Database from C or C++ applications.
[Azure Storage](/azure/storage/common/storage-introduction) is a cloud storage solution for modern applications that rely on durability, availability, and scalability to meet the needs of their customers. Connect to Azure Storage from C++ by using the Azure Storage Client Library for C++.
[ODBC Driver for SQL Server](/sql/connect/odbc/microsoft-odbc-driver-for-sql-server)
-The latest ODBC driver provides robust data access to Microsoft SQL Server and Microsoft Azure SQL Database for C/C++ based applications. Provides support for features including always encrypted, Azure Active Directory, and AlwaysOn Availability Groups. Also available for MacOS and Linux.
+The latest ODBC driver provides robust data access to Microsoft SQL Server and Microsoft Azure SQL Database for C/C++ based applications. Provides support for features including always encrypted, Azure Active Directory, and AlwaysOn Availability Groups. Also available for macOS and Linux.
[OLE DB Driver for SQL Server](/sql/connect/oledb/oledb-driver-for-sql-server)
The latest OLE DB driver is a stand-alone data access application programming interface (API) that supports Microsoft SQL Server and Microsoft Azure SQL Database.
diff --git a/docs/data/odbc/odbc-and-mfc.md b/docs/data/odbc/odbc-and-mfc.md
index 5f25751635..8a647cef02 100644
--- a/docs/data/odbc/odbc-and-mfc.md
+++ b/docs/data/odbc/odbc-and-mfc.md
@@ -1,14 +1,13 @@
---
-description: "Learn more about: ODBC and MFC"
title: "ODBC and MFC"
+description: "Learn more about: ODBC and MFC"
ms.date: "11/04/2016"
helpviewer_keywords: ["ODBC [C++], MFC", "connections [C++], databases", "connections [C++], data source", "databases [C++], connecting to", "data sources [C++], connecting to", "MFC [C++], ODBC and", "database connections [C++], MFC ODBC classes"]
-ms.assetid: 98f02fd7-1235-437b-89a9-edfd0fc797f7
---
# ODBC and MFC
> [!NOTE]
-> To use the MFC database classes, you must have the appropriate ODBC driver for your data source. The lastest Microsoft ODBC driver for SQL Server is [Microsoft ODBC Driver 13 for SQL Server](https://www.microsoft.com/download/details.aspx?id=50420). Most database vendors provide an ODBC driver for Windows.
+> To use the MFC database classes, you must have the appropriate ODBC driver for your data source. The lastest Microsoft ODBC driver for SQL Server is [Microsoft ODBC Driver 18 for SQL Server](/sql/connect/odbc/download-odbc-driver-for-sql-server). Most database vendors provide an ODBC driver for Windows.
This topic introduces the main concepts of the Microsoft Foundation Classes (MFC) library's ODBC-based database classes and provides an overview of how the classes work together. For more information about ODBC and MFC, see the following topics:
diff --git a/docs/data/oledb/cdbpropset-class.md b/docs/data/oledb/cdbpropset-class.md
index 9086c09dde..858162faf3 100644
--- a/docs/data/oledb/cdbpropset-class.md
+++ b/docs/data/oledb/cdbpropset-class.md
@@ -1,10 +1,9 @@
---
-description: "Learn more about: CDBPropSet Class"
title: "CDBPropSet Class"
+description: "Learn more about: CDBPropSet Class"
ms.date: "11/04/2016"
f1_keywords: ["CDBPropSet", "ATL.CDBPropSet", "ATL::CDBPropSet", "CDBPropSet::AddProperty", "CDBPropSet.AddProperty", "AddProperty", "ATL::CDBPropSet::AddProperty", "ATL.CDBPropSet.AddProperty", "CDBPropSet.CDBPropSet", "CDBPropSet::CDBPropSet", "ATL::CDBPropSet::CDBPropSet", "ATL.CDBPropSet.CDBPropSet", "CDBPropSet.operator=", "ATL::CDBPropSet::operator=", "ATL.CDBPropSet.operator=", "CDBPropSet::operator=", "ATL.CDBPropSet.SetGUID", "CDBPropSet.SetGUID", "ATL::CDBPropSet::SetGUID", "CDBPropSet::SetGUID"]
helpviewer_keywords: ["CDBPropSet class", "AddProperty method", "CDBPropSet class, constructor", "operator =, property sets", "= operator, with OLE DB templates", "operator=, property sets", "SetGUID method", "AddProperty method"]
-ms.assetid: 54190149-c277-4679-b81a-ef484d4d1c00
---
# CDBPropSet Class
@@ -144,8 +143,8 @@ CDBPropSet& operator =(CDBPropSet& propset) throw();
## See also
-[OLE DB Consumer Templates](../../data/oledb/ole-db-consumer-templates-cpp.md)
-[OLE DB Consumer Templates Reference](../../data/oledb/ole-db-consumer-templates-reference.md)
-[CDBPropIDSet Class](../../data/oledb/cdbpropidset-class.md)
-[DBPROPSET Structure](/previous-versions/windows/desktop/ms714367(v=vs.85))
+[OLE DB Consumer Templates](../../data/oledb/ole-db-consumer-templates-cpp.md)\
+[OLE DB Consumer Templates Reference](../../data/oledb/ole-db-consumer-templates-reference.md)\
+[CDBPropIDSet Class](../../data/oledb/cdbpropidset-class.md)\
+[DBPROPSET Structure](/previous-versions/windows/desktop/ms714367(v=vs.85))\
[DBPROP Structure](/previous-versions/windows/desktop/ms717970(v=vs.85))
diff --git a/docs/data/oledb/crowset-class.md b/docs/data/oledb/crowset-class.md
index d64fd3ebc5..d42f6d0f81 100644
--- a/docs/data/oledb/crowset-class.md
+++ b/docs/data/oledb/crowset-class.md
@@ -1,10 +1,9 @@
---
-description: "Learn more about: CRowset Class"
title: "CRowset Class"
+description: "Learn more about: CRowset Class"
ms.date: "11/04/2016"
f1_keywords: ["ATL.CRowset", "CRowset", "ATL::CRowset", "ATL::CRowset", "ATL.CRowset", "CRowset.AddRefRows", "CRowset.AddRefRows", "ATL.CRowset.AddRefRows", "AddRefRows", "CRowset::AddRefRows", "CRowset::AddRefRows", "ATL::CRowset::AddRefRows", "ATL.CRowset.AddRefRows", "ATL::CRowset::AddRefRows", "CRowset::Close", "ATL.CRowset.Close", "CRowset::Close", "CRowset.Close", "ATL.CRowset.Close", "ATL::CRowset::Close", "ATL::CRowset::Close", "CRowset.Close", "CRowset.Compare", "CRowset::Compare", "ATL.CRowset.Compare", "ATL::CRowset::Compare", "CRowset.Compare", "ATL::CRowset::Compare", "ATL.CRowset.Compare", "CRowset::Compare", "CRowset::CRowset", "CRowset.CRowset", "ATL::CRowset::CRowset", "ATL::CRowset::CRowset", "ATL.CRowset.CRowset", "CRowset.CRowset", "CRowset::CRowset", "ATL.CRowset.CRowset", "ATL::CRowset::Delete", "CRowset.Delete", "CRowset::Delete", "ATL.CRowset.Delete", "ATL::CRowset::Delete", "CRowset.Delete", "CRowset::Delete", "ATL.CRowset.Delete", "ATL.CRowset.FindNextRow", "CRowset.FindNextRow", "ATL::CRowset::FindNextRow", "CRowset::FindNextRow", "CRowset::FindNextRow", "CRowset.FindNextRow", "ATL.CRowset.FindNextRow", "ATL::CRowset::FindNextRow", "FindNextRow", "ATL::CRowset::GetApproximatePosition", "ATL::CRowset::GetApproximatePosition", "CRowset.GetApproximatePosition", "CRowset::GetApproximatePosition", "GetApproximatePosition", "ATL.CRowset.GetApproximatePosition", "CRowset::GetApproximatePosition", "CRowset::GetData", "ATL::CRowset::GetData", "ATL::CRowset::GetData", "ATL.CRowset.GetData", "CRowset.GetData", "CRowset::GetData", "CRowset.GetData", "ATL.CRowset.GetData", "CRowset::GetDataHere", "CRowset.GetDataHere", "CRowset.GetDataHere", "GetDataHere", "CRowset::GetDataHere", "ATL::CRowset::GetDataHere", "ATL::CRowset::GetDataHere", "ATL.CRowset.GetDataHere", "ATL.CRowset.GetDataHere", "ATL.CRowset.GetOriginalData", "CRowset::GetOriginalData", "ATL::CRowset::GetOriginalData", "ATL.CRowset.GetOriginalData", "CRowset::GetOriginalData", "ATL::CRowset::GetOriginalData", "CRowset.GetOriginalData", "CRowset.GetRowStatus", "ATL.CRowset.GetRowStatus", "ATL::CRowset::GetRowStatus", "CRowset::GetRowStatus", "ATL::CRowset::GetRowStatus", "CRowset::GetRowStatus", "ATL.CRowset.GetRowStatus", "CRowset.GetRowStatus", "ATL.CRowset.Insert", "CRowset.Insert", "CRowset.Insert", "CRowset::Insert", "ATL::CRowset::Insert", "ATL.CRowset.Insert", "CRowset::Insert", "ATL::CRowset::Insert", "CRowset::IsSameRow", "CRowset.IsSameRow", "ATL::CRowset::IsSameRow", "ATL.CRowset.IsSameRow", "CRowset::IsSameRow", "ATL.CRowset.IsSameRow", "CRowset.IsSameRow", "ATL::CRowset::IsSameRow", "CRowset::MoveFirst", "ATL::CRowset::MoveFirst", "CRowset.MoveFirst", "CRowset::MoveFirst", "CRowset.MoveFirst", "ATL.CRowset.MoveFirst", "ATL.CRowset.MoveFirst", "ATL::CRowset::MoveFirst", "ATL::CRowset