Fix warnings in til for an upcoming version of MSVC (#15087)

A trivial change. :)
This commit is contained in:
Leonard Hecker 2023-04-03 20:14:01 +02:00 committed by GitHub
parent 0105807be2
commit 7ddd98de0a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View File

@ -9,7 +9,8 @@ namespace til // Terminal Implementation Library. Also: "Today I Learned"
// a number of other color types.
#pragma warning(push)
// we can't depend on GSL here, so we use static_cast for explicit narrowing
#pragma warning(disable : 26472)
#pragma warning(disable : 26472) // Don't use a static_cast for arithmetic conversions. Use brace initialization, gsl::narrow_cast or gsl::narrow (type.1).
#pragma warning(disable : 26495) // Variable 'til::color::<unnamed-tag>::abgr' is uninitialized. Always initialize a member variable (type.6).
struct color
{
// Clang (10) has no trouble optimizing the COLORREF conversion operator, below, to a

View File

@ -16,6 +16,8 @@
#pragma warning(disable : 26459) // You called an STL function '...' with a raw pointer parameter at position '...' that may be unsafe ... (stl.1).
// small_vector::_data references potentially uninitialized data and so we can't pass it regular iterators which reference initialized data.
#pragma warning(disable : 26481) // Don't use pointer arithmetic. Use span instead (bounds.1).
// small_vector::_buffer is explicitly uninitialized, because we manage its initialization manually.
#pragma warning(disable : 26495) // Variable '...' is uninitialized. Always initialize a member variable (type.6).
namespace til
{