Skip to content

Commit

Permalink
Fix Warnings with MSVC (#307)
Browse files Browse the repository at this point in the history
  • Loading branch information
junrushao authored Jan 16, 2024
1 parent 5547b16 commit 5212d14
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions include/tvm/runtime/logging.h
Original file line number Diff line number Diff line change
Expand Up @@ -560,15 +560,26 @@ std::unique_ptr<std::string> LogCheckFormat(const X& x, const Y& y) {
return LogCheck##name<int, int>(x, y); \
}

#if defined(__GNUC__) || defined(__clang__) // GCC and Clang
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wsign-compare"
#elif defined(_MSC_VER) // MSVC
#pragma warning(push)
#pragma warning(disable : 4389) // '==' : signed/unsigned mismatch
#endif

TVM_CHECK_FUNC(_LT, <)
TVM_CHECK_FUNC(_GT, >)
TVM_CHECK_FUNC(_LE, <=)
TVM_CHECK_FUNC(_GE, >=)
TVM_CHECK_FUNC(_EQ, ==)
TVM_CHECK_FUNC(_NE, !=)

#if defined(__GNUC__) || defined(__clang__) // GCC and Clang
#pragma GCC diagnostic pop
#elif defined(_MSC_VER) // MSVC
#pragma warning(pop)
#endif

} // namespace detail

Expand Down

0 comments on commit 5212d14

Please sign in to comment.