From 037dd50277453eaf3338ad31b2f1fc7a014e696e Mon Sep 17 00:00:00 2001 From: Rageking8 <106309953+Rageking8@users.noreply.github.com> Date: Thu, 19 Jun 2025 22:30:57 +0800 Subject: [PATCH 1/4] Add backticks in `_SCL_SECURE_NO_WARNINGS` topic --- docs/standard-library/scl-secure-no-warnings.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/docs/standard-library/scl-secure-no-warnings.md b/docs/standard-library/scl-secure-no-warnings.md index fd9ef309d1..3c44da50ca 100644 --- a/docs/standard-library/scl-secure-no-warnings.md +++ b/docs/standard-library/scl-secure-no-warnings.md @@ -6,9 +6,9 @@ f1_keywords: ["_SCL_SECURE_NO_DEPRECATE", "_SCL_SECURE_NO_WARNINGS"] helpviewer_keywords: ["_SCL_SECURE_NO_DEPRECATE", "_SCL_SECURE_NO_WARNINGS"] ms.assetid: ef0ddea9-7c62-4b53-8b64-5f4fd369776f --- -# _SCL_SECURE_NO_WARNINGS +# `_SCL_SECURE_NO_WARNINGS` -Calling any of the potentially unsafe methods in the C++ Standard Library results in [Compiler Warning (level 3) C4996](../error-messages/compiler-warnings/compiler-warning-level-3-c4996.md). To disable this warning, define the macro _SCL_SECURE_NO_WARNINGS in your code: +Calling any of the potentially unsafe methods in the C++ Standard Library results in [Compiler Warning (level 3) C4996](../error-messages/compiler-warnings/compiler-warning-level-3-c4996.md). To disable this warning, define the macro `_SCL_SECURE_NO_WARNINGS` in your code: ```cpp #define _SCL_SECURE_NO_WARNINGS @@ -20,25 +20,25 @@ If you use precompiled headers, put this directive in your precompiled header fi Other ways to disable warning C4996 include: -- Using the [/D (Preprocessor Definitions)](../build/reference/d-preprocessor-definitions.md) compiler option: +- Using the [`/D` (Preprocessor Definitions)](../build/reference/d-preprocessor-definitions.md) compiler option: > cl /D_SCL_SECURE_NO_WARNINGS [other compiler options] myfile.cpp -- Using the [/w](../build/reference/compiler-option-warning-level.md) compiler option: +- Using the [`/w`](../build/reference/compiler-option-warning-level.md) compiler option: > cl /wd4996 [other compiler options] myfile.cpp -- Using the [#pragma warning](../preprocessor/warning.md) directive: +- Using the [`#pragma warning`](../preprocessor/warning.md) directive: ```cpp #pragma warning(disable:4996) ``` -Also, you can manually change the level of warning C4996 with the **/w\\** compiler option. For example, to set warning C4996 to level 4: +Also, you can manually change the level of warning C4996 with the `/w` compiler option. For example, to set warning C4996 to level 4: > cl /w44996 [other compiler options] myfile.cpp -For more information, see [/w, /W0, /W1, /W2, /W3, /W4, /w1, /w2, /w3, /w4, /Wall, /wd, /we, /wo, /Wv, /WX (Warning Level)](../build/reference/compiler-option-warning-level.md). +For more information, see [`/w`, `/W0`, `/W1`, `/W2`, `/W3`, `/W4`, `/w1`, `/w2`, `/w3`, `/w4`, `/Wall`, `/wd`, `/we`, `/wo`, `/Wv`, `/WX` (Warning Level)](../build/reference/compiler-option-warning-level.md). ## See also From 12eb4b8e43e1c20b1fa6dcc60268d54db328b84c Mon Sep 17 00:00:00 2001 From: Rageking8 <106309953+Rageking8@users.noreply.github.com> Date: Thu, 19 Jun 2025 22:34:37 +0800 Subject: [PATCH 2/4] Replace CL invocation blockquotes with code blocks in `_SCL_SECURE_NO_WARNINGS` topic --- docs/standard-library/scl-secure-no-warnings.md | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/docs/standard-library/scl-secure-no-warnings.md b/docs/standard-library/scl-secure-no-warnings.md index 3c44da50ca..c8fd257b5d 100644 --- a/docs/standard-library/scl-secure-no-warnings.md +++ b/docs/standard-library/scl-secure-no-warnings.md @@ -22,11 +22,15 @@ Other ways to disable warning C4996 include: - Using the [`/D` (Preprocessor Definitions)](../build/reference/d-preprocessor-definitions.md) compiler option: - > cl /D_SCL_SECURE_NO_WARNINGS [other compiler options] myfile.cpp + ```cmd + cl /D_SCL_SECURE_NO_WARNINGS [other compiler options] myfile.cpp + ``` - Using the [`/w`](../build/reference/compiler-option-warning-level.md) compiler option: - > cl /wd4996 [other compiler options] myfile.cpp + ```cmd + cl /wd4996 [other compiler options] myfile.cpp + ``` - Using the [`#pragma warning`](../preprocessor/warning.md) directive: @@ -36,7 +40,9 @@ Other ways to disable warning C4996 include: Also, you can manually change the level of warning C4996 with the `/w` compiler option. For example, to set warning C4996 to level 4: -> cl /w44996 [other compiler options] myfile.cpp +```cmd +cl /w44996 [other compiler options] myfile.cpp +``` For more information, see [`/w`, `/W0`, `/W1`, `/W2`, `/W3`, `/W4`, `/w1`, `/w2`, `/w3`, `/w4`, `/Wall`, `/wd`, `/we`, `/wo`, `/Wv`, `/WX` (Warning Level)](../build/reference/compiler-option-warning-level.md). From 3b7b7decd94196b2d41455add40e3e59eb977fd3 Mon Sep 17 00:00:00 2001 From: Rageking8 <106309953+Rageking8@users.noreply.github.com> Date: Thu, 19 Jun 2025 22:35:46 +0800 Subject: [PATCH 3/4] Fix a single redundant relative link in `_SCL_SECURE_NO_WARNINGS` topic --- docs/standard-library/scl-secure-no-warnings.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/standard-library/scl-secure-no-warnings.md b/docs/standard-library/scl-secure-no-warnings.md index c8fd257b5d..ac9d4431a6 100644 --- a/docs/standard-library/scl-secure-no-warnings.md +++ b/docs/standard-library/scl-secure-no-warnings.md @@ -48,4 +48,4 @@ For more information, see [`/w`, `/W0`, `/W1`, `/W2`, `/W3`, `/W4`, `/w1`, `/w2` ## See also -[Safe Libraries: C++ Standard Library](../standard-library/safe-libraries-cpp-standard-library.md) +[Safe Libraries: C++ Standard Library](safe-libraries-cpp-standard-library.md) From d310d0875e8a053ba01c53092043ff53526ee4c1 Mon Sep 17 00:00:00 2001 From: Rageking8 <106309953+Rageking8@users.noreply.github.com> Date: Thu, 19 Jun 2025 22:36:18 +0800 Subject: [PATCH 4/4] Update metadata for `_SCL_SECURE_NO_WARNINGS` topic --- docs/standard-library/scl-secure-no-warnings.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/docs/standard-library/scl-secure-no-warnings.md b/docs/standard-library/scl-secure-no-warnings.md index ac9d4431a6..10be87757e 100644 --- a/docs/standard-library/scl-secure-no-warnings.md +++ b/docs/standard-library/scl-secure-no-warnings.md @@ -1,10 +1,9 @@ --- -description: "Learn more about: _SCL_SECURE_NO_WARNINGS" title: "_SCL_SECURE_NO_WARNINGS" -ms.date: "11/04/2016" +description: "Learn more about: _SCL_SECURE_NO_WARNINGS" +ms.date: 11/04/2016 f1_keywords: ["_SCL_SECURE_NO_DEPRECATE", "_SCL_SECURE_NO_WARNINGS"] helpviewer_keywords: ["_SCL_SECURE_NO_DEPRECATE", "_SCL_SECURE_NO_WARNINGS"] -ms.assetid: ef0ddea9-7c62-4b53-8b64-5f4fd369776f --- # `_SCL_SECURE_NO_WARNINGS`