Skip to content

Commit

Permalink
Merge pull request #5633 from MicrosoftDocs/FromPublicMasterBranch
Browse files Browse the repository at this point in the history
Confirm merge from FromPublicMasterBranch to main to sync with https://github.com/MicrosoftDocs/cpp-docs (branch main)
  • Loading branch information
Albertyang0 authored Aug 5, 2024
2 parents c7b8b0d + 5a729ee commit 904729f
Show file tree
Hide file tree
Showing 21 changed files with 42 additions and 44 deletions.
3 changes: 1 addition & 2 deletions docs/build/reference/analyze-code-analysis.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ description: "The Microsoft C++ compiler /analyze option syntax and usage."
ms.date: 02/17/2022
f1_keywords: ["VC.Project.VCCLCompilerTool.EnablePREfast", "/analyze", "VC.Project.VCCLCompilerTool.PREfastAdditionalOptions", "VC.Project.VCCLCompilerTool.PREfastAdditionalPlugins", "VC.Project.VCCLCompilerTool.DisableAnalyzeExternal", "VC.Project.VCCLCompilerTool.AnalyzeExternalRuleset"]
helpviewer_keywords: ["/analyze compiler option [C++]", "-analyze compiler option [C++]", "analyze compiler option [C++]"]
ms.assetid: 81da536a-e030-4bd4-be18-383927597d08
---
# `/analyze` (Code analysis)

Expand Down Expand Up @@ -135,7 +134,7 @@ Then, use compiler option `/analyze:plugin EspXEngine.dll` to use the EspXEngine

#### External file analysis options

Starting in Visual Studio 2019 version 16.10, you can specify different analysis rules and behavior for external headers. Use the **`/external:I`**, **`/external:env`**, or **`/external:anglebrackets`** options to specify directories as "external" directories. Any files that are included by using `#include`from an external directory or its subdirectories are considered as external headers. For more information, see [`/external` (External headers diagnostics)](external-external-headers-diagnostics.md).
Starting in Visual Studio 2019 version 16.10, you can specify different analysis rules and behavior for external headers. Use the **`/external:I`**, **`/external:env`**, or **`/external:anglebrackets`** options to specify directories as "external" directories. Any files that are included by using `#include` from an external directory or its subdirectories are considered as external headers. For more information, see [`/external` (External headers diagnostics)](external-external-headers-diagnostics.md).

Code analysis provides these options to control analysis of external files:

Expand Down
6 changes: 3 additions & 3 deletions docs/build/walkthrough-import-stl-header-units.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
description: "Learn to use header units to import C++ Standard Template Library (STL) libraries in Visual Studio."
title: "Walkthrough: Import STL libraries as header units"
description: "Learn to use header units to import C++ Standard Template Library (STL) libraries in Visual Studio."
ms.date: 10/15/2022
ms.custom: "conceptual"
author: "tylermsft"
Expand Down Expand Up @@ -170,7 +170,7 @@ This option is convenient when your project includes many STL header files acros
This approach is less flexible than the static library approach, because it doesn't lend itself towards reusing the built header units in other projects. This approach might not be appropriate for larger projects: It doesn't guarantee an optimal build time, since all of the sources must be scanned for `#include` statements.
Not all header files can be automatically converted to header units. For example, headers that depend on conditional compilation via macros shouldn't be converted to header units. There's an allowlist in the form of a `header-units.json`file for the STL headers that the compiler uses when `/translateInclude` is specified. It determines which STL headers can be compiled into header units. The `header-units.json` file is under the installation directory for Visual Studio. For example, `%ProgramFiles%\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.30.30705\include\header-units.json`. If the STL header file isn't on the list, it's treated as a normal `#include` instead of importing it as a header unit. Another advantage of the `header-units.json` file is that it prevents symbol duplication in the built header units. That is, if compiling a header unit brings in another library header multiple times, the symbols won't be duplicated.
Not all header files can be automatically converted to header units. For example, headers that depend on conditional compilation via macros shouldn't be converted to header units. There's an allowlist in the form of a `header-units.json` file for the STL headers that the compiler uses when `/translateInclude` is specified. It determines which STL headers can be compiled into header units. The `header-units.json` file is under the installation directory for Visual Studio. For example, `%ProgramFiles%\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.30.30705\include\header-units.json`. If the STL header file isn't on the list, it's treated as a normal `#include` instead of importing it as a header unit. Another advantage of the `header-units.json` file is that it prevents symbol duplication in the built header units. That is, if compiling a header unit brings in another library header multiple times, the symbols won't be duplicated.
To try out this approach, create a project that includes two STL libraries. Then, change the project's properties so that it imports the libraries as header units instead of including them, as described in the next section.
Expand Down Expand Up @@ -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)
[`/translateInclude`](./reference/translateinclude.md)
2 changes: 1 addition & 1 deletion docs/c-runtime-library/reference/nextafter-functions.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ The **`nextafter`** and **`nexttoward`** function families are equivalent, excep
Because C++ allows overloading, if you include `<cmath>` you can call overloads of **`nextafter`** and **`nexttoward`** that return **`float`** and **`long double`** types. In a C program, unless you're using the `<tgmath.h>` macro to call this function, **`nextafter`** and **`nexttoward`** always return **`double`**.
If you use the `nextafter` or `nexttoward`macro from `<tgmath.h>`, 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 `<tgmath.h>`, 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.
Expand Down
4 changes: 2 additions & 2 deletions docs/c-runtime-library/reference/stat-functions.md
Original file line number Diff line number Diff line change
@@ -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"]
Expand Down Expand Up @@ -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).

Expand Down
4 changes: 2 additions & 2 deletions docs/code-quality/c26837.md
Original file line number Diff line number Diff line change
@@ -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"]
Expand Down Expand Up @@ -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`.
Expand Down
4 changes: 2 additions & 2 deletions docs/ide/add-interface-definition-library-method-wizard.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
description: "Learn more about: Use a Microsoft Visual Studio wizard to add a method to an interface definition language (IDL) interface in your project"
title: "Add an IDL method"
description: "Learn more about: Use a Microsoft Visual Studio wizard to add a method to an interface definition language (IDL) interface in your project"
ms.date: "04/13/2022"
f1_keywords: ["vc.codewiz.method.overview", "vc.codewiz.method.idlattrib"]
helpviewer_keywords: ["add IDL method wizard [C++]", "IDL methods [C++], adding", "methods [C++], adding using wizards", "IDL attributes, add an IDL method wizard"]
Expand All @@ -20,7 +20,7 @@ This wizard differs from the [**Add method**](adding-a-method-visual-cpp.md) wiz

1. On the **View** menu, select **Class View**.

1. In the **Class View** pane, expand the project node to display the IDL interface (`.idl`file) to which you want to add the method.
1. In the **Class View** pane, expand the project node to display the IDL interface (`.idl` file) to which you want to add the method.

1. Right-click the name of the interface.

Expand Down
2 changes: 1 addition & 1 deletion docs/linux/connect-to-your-remote-linux-computer.md
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ sudo apt install g++ gdb make ninja-build rsync zip

### Fix WSL `localhost` connection problems

When connecting to Windows Subsystem for Linux (WSL) on `localhost`, you may run into a conflict with the Windows `ssh` client on port 22. In WSL, change the port that `ssh`expects requests from to 23 in `/etc/ssh/sshd_config`:
When connecting to Windows Subsystem for Linux (WSL) on `localhost`, you may run into a conflict with the Windows `ssh` client on port 22. In WSL, change the port that `ssh` expects requests from to 23 in `/etc/ssh/sshd_config`:

```bash
Port 23
Expand Down
Loading

0 comments on commit 904729f

Please sign in to comment.