Skip to content

Commit

Permalink
Fix warning suppression in the json utility. (#2462)
Browse files Browse the repository at this point in the history
Properly push and pop the warning configuration to avoid unintentional
side effects. The previous solution could overwrite command line options
and the inclusion of the header can change what warnings are enabled.
  • Loading branch information
Xazax-hun committed Dec 23, 2023
1 parent 9ac6b24 commit a779dbe
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/include/souffle/utility/json11.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
#include <vector>

#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable : 4244)
#if _MSC_VER <= 1800 // VS 2013
#ifndef noexcept
Expand Down Expand Up @@ -1111,7 +1112,7 @@ inline std::vector<Json> parse_multi(const std::string& in, std::string::size_ty
}

#ifdef _MSC_VER
#pragma warning(default : 4244)
#pragma warning(pop)
#endif // _MSC_VER

} // namespace json11
Expand Down

0 comments on commit a779dbe

Please sign in to comment.