This is an automated email from the ASF dual-hosted git repository.
junrushao pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tvm.git
The following commit(s) were added to refs/heads/main by this push:
new 26c6b135e6 fix: MSVC pragma (#18674)
26c6b135e6 is described below
commit 26c6b135e66eb80d3edb5d360c4880ef538cdb46
Author: Junru Shao <[email protected]>
AuthorDate: Mon Jan 19 20:21:18 2026 -0800
fix: MSVC pragma (#18674)
The line below is not a MSVC syntax
```
#pragma disagnostic push
```
instead, we should always use:
```
#pragma warning(push)
```
in MSVC.
---
include/tvm/runtime/logging.h | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/include/tvm/runtime/logging.h b/include/tvm/runtime/logging.h
index f39a07b3d9..b3c5a056f9 100644
--- a/include/tvm/runtime/logging.h
+++ b/include/tvm/runtime/logging.h
@@ -269,12 +269,12 @@ class LogFatal {
public:
LogFatal(const std::string& file, int lineno) : file_(file), lineno_(lineno)
{}
#ifdef _MSC_VER
-#pragma disagnostic push
+#pragma warning(push)
#pragma warning(disable : 4722)
#endif
[[noreturn]] ~LogFatal() TVM_THROW_EXCEPTION { LogFatalImpl(file_, lineno_,
stream_.str()); }
#ifdef _MSC_VER
-#pragma disagnostic pop
+#pragma warning(pop)
#endif
std::ostringstream& stream() { return stream_; }
@@ -314,7 +314,7 @@ class LogFatal {
public:
TVM_NO_INLINE LogFatal(const char* file, int lineno) { GetEntry().Init(file,
lineno); }
#ifdef _MSC_VER
-#pragma disagnostic push
+#pragma warning(push)
#pragma warning(disable : 4722)
#endif
[[noreturn]] ~LogFatal() TVM_THROW_EXCEPTION {
@@ -322,7 +322,7 @@ class LogFatal {
throw;
}
#ifdef _MSC_VER
-#pragma disagnostic pop
+#pragma warning(pop)
#endif
std::ostringstream& stream() { return GetEntry().stream_; }