Skip to content

Commit

Permalink
disable C26451 for to_chars.hpp
Browse files Browse the repository at this point in the history
  • Loading branch information
dota17 committed Feb 29, 2020
1 parent 0feea61 commit 096714f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
7 changes: 7 additions & 0 deletions include/nlohmann/detail/conversions/to_chars.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ For a detailed description of the algorithm see:
*/
namespace dtoa_impl
{
#if JSON_HEDLEY_MSVC_VERSION_CHECK(19,20,0)
JSON_HEDLEY_DIAGNOSTIC_PUSH
__pragma(warning(disable: 26451)) // arithmetic overflow
#endif

template <typename Target, typename Source>
Target reinterpret_bits(const Source source)
Expand Down Expand Up @@ -1042,6 +1046,9 @@ inline char* format_buffer(char* buf, int len, int decimal_exponent,
return append_exponent(buf, n - 1);
}

#if JSON_HEDLEY_MSVC_VERSION_CHECK(19,20,0)
JSON_HEDLEY_DIAGNOSTIC_POP
#endif
} // namespace dtoa_impl

/*!
Expand Down
7 changes: 7 additions & 0 deletions single_include/nlohmann/json.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12685,6 +12685,10 @@ For a detailed description of the algorithm see:
*/
namespace dtoa_impl
{
#if JSON_HEDLEY_MSVC_VERSION_CHECK(19,20,0)
JSON_HEDLEY_DIAGNOSTIC_PUSH
__pragma(warning(disable: 26451)) // arithmetic overflow
#endif

template <typename Target, typename Source>
Target reinterpret_bits(const Source source)
Expand Down Expand Up @@ -13691,6 +13695,9 @@ inline char* format_buffer(char* buf, int len, int decimal_exponent,
return append_exponent(buf, n - 1);
}

#if JSON_HEDLEY_MSVC_VERSION_CHECK(19,20,0)
JSON_HEDLEY_DIAGNOSTIC_POP
#endif
} // namespace dtoa_impl

/*!
Expand Down

0 comments on commit 096714f

Please sign in to comment.