Skip to content

Commit

Permalink
Suppress warnings introduced with Visual Studio 2022 17.8.0 Preview 3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
vbaderks committed Oct 14, 2023
1 parent 881a38a commit 10f68b0
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,9 @@
C5246 = the initialization of a subobject should be wrapped in braces [prevents simple usage of std::byte]
C5264 = 'const' variable is not used [reported for const in header files]
C5258 = explicit capture of '' is not required for this use [VS 2019 requires capture of constexpr]
C6393 = A lookup table of size 365 is not sufficient to handle leap years [CharLS doesn't handle leap years]
-->
<DisableSpecificWarnings Condition="'$(CHARLS_ALL_WARNINGS)'!=''">4061;4365;4464;4514;4571;4623;4625;4626;4710;4711;4738;4820;5026;5027;5045;5246;5264;5258</DisableSpecificWarnings>
<DisableSpecificWarnings Condition="'$(CHARLS_ALL_WARNINGS)'!=''">4061;4365;4464;4514;4571;4623;4625;4626;4710;4711;4738;4820;5026;5027;5045;5246;5264;5258;6393</DisableSpecificWarnings>

<!--
__cplusplus = Use the correct value for the __cplusplus macro
Expand Down
2 changes: 1 addition & 1 deletion default.ruleset.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ C26472: Don't use static_cast for arithmetic conversions
-> Rationale: can only be solved with gsl::narrow_cast

C26478: Don't use std::move on constant variables. (es.56).
-> Rationale: false warnings [Visual Studio 2022 17.7.0]
-> Rationale: false warnings [Visual Studio 2022 17.7.0, note: fixed in 17.8.0]

C26481: Do not pass an array as a single pointer.
-> Rationale: gsl::span is not available.
Expand Down
4 changes: 2 additions & 2 deletions src/jpeg_stream_reader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ void jpeg_stream_reader::read_next_start_of_scan()
ASSERT(state_ == state::bit_stream_section);
state_ = state::scan_section;

do
do // NOLINT(cppcoreguidelines-avoid-do-while): the loop must be executed at least once.
{
const jpeg_marker_code marker_code{read_next_marker_code()};
validate_marker_code(marker_code);
Expand All @@ -129,7 +129,7 @@ jpeg_marker_code jpeg_stream_reader::read_next_marker_code()
throw_jpegls_error(jpegls_errc::jpeg_marker_start_byte_not_found);

// Read all preceding 0xFF fill values until a non 0xFF value has been found. (see ISO/IEC 10918-1, B.1.1.2)
do
do // NOLINT(cppcoreguidelines-avoid-do-while): the loop must be executed at least once.
{
value = read_byte_checked();
} while (value == jpeg_marker_start_byte);
Expand Down

0 comments on commit 10f68b0

Please sign in to comment.