Skip to content

Commit d6208c1

Browse files
authored
Merge pull request #4781 from MicrosoftDocs/main
2/03 AM Publish
2 parents 36ca236 + 96afa49 commit d6208c1

File tree

4 files changed

+37
-33
lines changed

4 files changed

+37
-33
lines changed
Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
description: "Learn more about: /WX (Treat linker warnings as errors)"
33
title: "/WX (Treat linker warnings as errors)"
4-
ms.date: 09/08/2022
4+
ms.date: 02/02/2023
55
f1_keywords: ["VC.Project.VCLinkerTool.TreatLinkerWarningsAsErrors"]
66
helpviewer_keywords: ["/WX linker option", "-WX linker option", "WX linker option"]
77
ms.assetid: e4ba97c7-93f7-43ae-a4bb-d866790926c9
@@ -13,22 +13,31 @@ Specifies whether to treat linker warnings as errors.
1313
## Syntax
1414

1515
> **`/WX`**\[**`:NO`**]
16+
> **`/WX`**\[**`:`***`nnnn`*[**`,`***`nnnn`*...]]
1617
1718
## Remarks
1819

1920
The **`/WX`** linker option causes no output file to be generated if the linker generates a warning.
2021

2122
This option is similar to **`/WX`** for the compiler. For more information, see [/w, /W0, /W1, /W2, /W3, /W4, /w1, /w2, /w3, /w4, /Wall, /wd, /we, /wo, /Wv, /WX (Warning Level)](compiler-option-warning-level.md). However, specifying **`/WX`** for the compilation doesn't imply that **`/WX`** will also be in effect for the link phase; you must explicitly specify **`/WX`** for each tool.
2223

23-
By default, **`/WX`** isn't in effect. To treat linker warnings as errors, specify **`/WX`**. **`/WX:NO`** is the same as not specifying **`/WX`**.
24+
In Visual Studio 2022 and later versions, you can specify **`/WX`** with one or more comma-separated *`nnnn`* arguments, where *`nnnn`* is a number between 4000 and 4999. The linker treats the corresponding *`LNKnnnn`* warnings as errors.
25+
26+
By default, **`/WX`** isn't in effect. To treat linker warnings as errors, specify a **`/WX`** option. **`/WX:NO`** is the same as not specifying **`/WX`**, and overrides any previous **`/WX`** linker option.
2427

2528
### To set this linker option in the Visual Studio development environment
2629

2730
1. Open the project's **Property Pages** dialog box. For more information, see [Set compiler and build properties](../working-with-project-properties.md).
2831

29-
1. Select the **Configuration Properties** > **Linker** > **General** property page.
32+
1. To set or unset all warnings as errors, select the **Configuration Properties** > **Linker** > **General** property page.
33+
34+
1. Modify the **Treat Linker Warnings as Errors** property.
35+
36+
1. To set specific warnings as errors, select the **Configuration Properties** > **Linker** > **Command Line** property page.
37+
38+
1. In the **Additional Options** edit control, add *`/WX:warnings`*, where *`warnings`* is a comma-separated list of linker warning numbers.
3039

31-
1. Modify the **Treat Linker Warnings as Errors** property. Choose **OK** or **Apply** to save your changes.
40+
1. Choose **OK** or **Apply** to save your changes.
3241

3342
### To set this linker option programmatically
3443

@@ -37,4 +46,5 @@ By default, **`/WX`** isn't in effect. To treat linker warnings as errors, speci
3746
## See also
3847

3948
[MSVC linker reference](linking.md)\
40-
[MSVC linker options](linker-options.md)
49+
[MSVC linker options](linker-options.md)\
50+
[`/WX` compiler option](./compiler-option-warning-level.md)

docs/c-runtime-library/errno-doserrno-sys-errlist-and-sys-nerr.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@
22
description: "Learn more about: errno, _doserrno, _sys_errlist, and _sys_nerr"
33
title: "errno, _doserrno, _sys_errlist, and _sys_nerr"
44
ms.date: "11/04/2016"
5-
api_name: ["_errno"]
6-
api_location: ["msvcrt.dll"]
7-
api_type: ["DLLExport"]
8-
topic_type: ["apiref"]
95
f1_keywords: ["errno", "ERRNO/errno", "_doserrno", "ERRNO/_doserrno", "_sys_errlist", "STDLIB/_sys_errlist", "_sys_nerr", "STDLIB/_sys_nerr"]
106
helpviewer_keywords: ["error codes, printing", "sys_errlist global variable", "doserrno global variable", "errno global variable", "_doserrno global variable", "_sys_errlist global variable", "_sys_nerr global variable", "sys_nerr global variable"]
117
ms.assetid: adbec641-6d91-4e19-8398-9a34046bd369

0 commit comments

Comments
 (0)