Skip to content

Commit bf44b6c

Browse files
authored
Fix a misdiagnosis in MSVC 17.11 (#17723)
Mo' compiler, mo' problems.
1 parent 1511d2c commit bf44b6c

File tree

4 files changed

+16
-0
lines changed

4 files changed

+16
-0
lines changed

src/buffer/out/OutputCell.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@
99
#include "../../types/inc/convert.hpp"
1010
#include "../../inc/conattrs.hpp"
1111

12+
// BODGY: Misdiagnosis in MSVC 17.11: Referencing global constants in the member
13+
// initializer list leads to this warning. Can probably be removed in the future.
14+
#pragma warning(disable : 26493) // Don't use C-style casts (type.4).)
15+
1216
static constexpr TextAttribute InvalidTextAttribute{ INVALID_COLOR, INVALID_COLOR };
1317

1418
OutputCell::OutputCell() noexcept :

src/buffer/out/OutputCellIterator.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@
1111
#include "../../types/inc/GlyphWidth.hpp"
1212
#include "../../inc/conattrs.hpp"
1313

14+
// BODGY: Misdiagnosis in MSVC 17.11: Referencing global constants in the member
15+
// initializer list leads to this warning. Can probably be removed in the future.
16+
#pragma warning(disable : 26493) // Don't use C-style casts (type.4).)
17+
1418
static constexpr TextAttribute InvalidTextAttribute{ INVALID_COLOR, INVALID_COLOR, INVALID_COLOR };
1519

1620
// Routine Description:

src/buffer/out/OutputCellView.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@
55

66
#include "OutputCellView.hpp"
77

8+
// BODGY: Misdiagnosis in MSVC 17.11: Referencing global constants in the member
9+
// initializer list leads to this warning. Can probably be removed in the future.
10+
#pragma warning(disable : 26493) // Don't use C-style casts (type.4).)
11+
812
// Routine Description:
913
// - Constructs a read-only view of data formatted as a single output buffer cell
1014
// Arguments:

src/buffer/out/textBuffer.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@
1212
#include "../types/inc/utils.hpp"
1313
#include "search.h"
1414

15+
// BODGY: Misdiagnosis in MSVC 17.11: Referencing global constants in the member
16+
// initializer list leads to this warning. Can probably be removed in the future.
17+
#pragma warning(disable : 26493) // Don't use C-style casts (type.4).)
18+
1519
using namespace Microsoft::Console;
1620
using namespace Microsoft::Console::Types;
1721

0 commit comments

Comments
 (0)