Skip to content

Commit

Permalink
Fix warnings in til for an upcoming version of MSVC (#15087)
Browse files Browse the repository at this point in the history
A trivial change. :)
  • Loading branch information
lhecker authored Apr 3, 2023
1 parent 0105807 commit 7ddd98d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/inc/til/color.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions src/inc/til/small_vector.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down

0 comments on commit 7ddd98d

Please sign in to comment.