From d7eb27321da9246f2e115bed325083b4a49876e5 Mon Sep 17 00:00:00 2001 From: Leonard Hecker Date: Thu, 15 Aug 2024 16:16:38 +0200 Subject: [PATCH 1/2] Fix misdiagnosis in MSVC 17.11 --- src/buffer/out/OutputCell.cpp | 4 ++++ src/buffer/out/OutputCellIterator.cpp | 4 ++++ src/buffer/out/OutputCellView.cpp | 4 ++++ src/buffer/out/textBuffer.cpp | 4 ++++ 4 files changed, 16 insertions(+) diff --git a/src/buffer/out/OutputCell.cpp b/src/buffer/out/OutputCell.cpp index fef9dcb0288..ab28310ffc3 100644 --- a/src/buffer/out/OutputCell.cpp +++ b/src/buffer/out/OutputCell.cpp @@ -9,6 +9,10 @@ #include "../../types/inc/convert.hpp" #include "../../inc/conattrs.hpp" +// Misdiagnosis in MSVC 17.11: Referencing global constants in the member initializer +// list leads to this warning. Can probably be removed in the future. +#pragma warning(disable : 26493) // Don't use C-style casts (type.4).) + static constexpr TextAttribute InvalidTextAttribute{ INVALID_COLOR, INVALID_COLOR }; OutputCell::OutputCell() noexcept : diff --git a/src/buffer/out/OutputCellIterator.cpp b/src/buffer/out/OutputCellIterator.cpp index 423816437e9..ae48f2ebdcd 100644 --- a/src/buffer/out/OutputCellIterator.cpp +++ b/src/buffer/out/OutputCellIterator.cpp @@ -11,6 +11,10 @@ #include "../../types/inc/GlyphWidth.hpp" #include "../../inc/conattrs.hpp" +// Misdiagnosis in MSVC 17.11: Referencing global constants in the member initializer +// list leads to this warning. Can probably be removed in the future. +#pragma warning(disable : 26493) // Don't use C-style casts (type.4).) + static constexpr TextAttribute InvalidTextAttribute{ INVALID_COLOR, INVALID_COLOR, INVALID_COLOR }; // Routine Description: diff --git a/src/buffer/out/OutputCellView.cpp b/src/buffer/out/OutputCellView.cpp index 7240a4d0c29..3efb6d090b2 100644 --- a/src/buffer/out/OutputCellView.cpp +++ b/src/buffer/out/OutputCellView.cpp @@ -5,6 +5,10 @@ #include "OutputCellView.hpp" +// Misdiagnosis in MSVC 17.11: Referencing global constants in the member initializer +// list leads to this warning. Can probably be removed in the future. +#pragma warning(disable : 26493) // Don't use C-style casts (type.4).) + // Routine Description: // - Constructs a read-only view of data formatted as a single output buffer cell // Arguments: diff --git a/src/buffer/out/textBuffer.cpp b/src/buffer/out/textBuffer.cpp index 42d057515e9..6523c42f492 100644 --- a/src/buffer/out/textBuffer.cpp +++ b/src/buffer/out/textBuffer.cpp @@ -12,6 +12,10 @@ #include "../types/inc/utils.hpp" #include "search.h" +// Misdiagnosis in MSVC 17.11: Referencing global constants in the member initializer +// list leads to this warning. Can probably be removed in the future. +#pragma warning(disable : 26493) // Don't use C-style casts (type.4).) + using namespace Microsoft::Console; using namespace Microsoft::Console::Types; From d377e7183db710b7d079b9a40094116ef0f612d7 Mon Sep 17 00:00:00 2001 From: Leonard Hecker Date: Thu, 15 Aug 2024 18:07:29 +0200 Subject: [PATCH 2/2] Address feedback --- src/buffer/out/OutputCell.cpp | 4 ++-- src/buffer/out/OutputCellIterator.cpp | 4 ++-- src/buffer/out/OutputCellView.cpp | 4 ++-- src/buffer/out/textBuffer.cpp | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/buffer/out/OutputCell.cpp b/src/buffer/out/OutputCell.cpp index ab28310ffc3..47e14342cea 100644 --- a/src/buffer/out/OutputCell.cpp +++ b/src/buffer/out/OutputCell.cpp @@ -9,8 +9,8 @@ #include "../../types/inc/convert.hpp" #include "../../inc/conattrs.hpp" -// Misdiagnosis in MSVC 17.11: Referencing global constants in the member initializer -// list leads to this warning. Can probably be removed in the future. +// BODGY: Misdiagnosis in MSVC 17.11: Referencing global constants in the member +// initializer list leads to this warning. Can probably be removed in the future. #pragma warning(disable : 26493) // Don't use C-style casts (type.4).) static constexpr TextAttribute InvalidTextAttribute{ INVALID_COLOR, INVALID_COLOR }; diff --git a/src/buffer/out/OutputCellIterator.cpp b/src/buffer/out/OutputCellIterator.cpp index ae48f2ebdcd..55f49d40a77 100644 --- a/src/buffer/out/OutputCellIterator.cpp +++ b/src/buffer/out/OutputCellIterator.cpp @@ -11,8 +11,8 @@ #include "../../types/inc/GlyphWidth.hpp" #include "../../inc/conattrs.hpp" -// Misdiagnosis in MSVC 17.11: Referencing global constants in the member initializer -// list leads to this warning. Can probably be removed in the future. +// BODGY: Misdiagnosis in MSVC 17.11: Referencing global constants in the member +// initializer list leads to this warning. Can probably be removed in the future. #pragma warning(disable : 26493) // Don't use C-style casts (type.4).) static constexpr TextAttribute InvalidTextAttribute{ INVALID_COLOR, INVALID_COLOR, INVALID_COLOR }; diff --git a/src/buffer/out/OutputCellView.cpp b/src/buffer/out/OutputCellView.cpp index 3efb6d090b2..331068505ca 100644 --- a/src/buffer/out/OutputCellView.cpp +++ b/src/buffer/out/OutputCellView.cpp @@ -5,8 +5,8 @@ #include "OutputCellView.hpp" -// Misdiagnosis in MSVC 17.11: Referencing global constants in the member initializer -// list leads to this warning. Can probably be removed in the future. +// BODGY: Misdiagnosis in MSVC 17.11: Referencing global constants in the member +// initializer list leads to this warning. Can probably be removed in the future. #pragma warning(disable : 26493) // Don't use C-style casts (type.4).) // Routine Description: diff --git a/src/buffer/out/textBuffer.cpp b/src/buffer/out/textBuffer.cpp index 6523c42f492..c4f38d85d91 100644 --- a/src/buffer/out/textBuffer.cpp +++ b/src/buffer/out/textBuffer.cpp @@ -12,8 +12,8 @@ #include "../types/inc/utils.hpp" #include "search.h" -// Misdiagnosis in MSVC 17.11: Referencing global constants in the member initializer -// list leads to this warning. Can probably be removed in the future. +// BODGY: Misdiagnosis in MSVC 17.11: Referencing global constants in the member +// initializer list leads to this warning. Can probably be removed in the future. #pragma warning(disable : 26493) // Don't use C-style casts (type.4).) using namespace Microsoft::Console;