You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by we...@apache.org on 2018/08/08 16:35:47 UTC
[arrow] branch master updated: ARROW-2986: [C++] Use /EHsc flag for
exception handling on MSVC,
disable C4772 compiler warning in arrow/util/logging.h
This is an automated email from the ASF dual-hosted git repository.
wesm pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/arrow.git
The following commit(s) were added to refs/heads/master by this push:
new e9c52f2 ARROW-2986: [C++] Use /EHsc flag for exception handling on MSVC, disable C4772 compiler warning in arrow/util/logging.h
e9c52f2 is described below
commit e9c52f242d894342f784b07a883bc45e1b173b29
Author: Wes McKinney <we...@apache.org>
AuthorDate: Wed Aug 8 12:35:42 2018 -0400
ARROW-2986: [C++] Use /EHsc flag for exception handling on MSVC, disable C4772 compiler warning in arrow/util/logging.h
I'm not sure when these warnings appeared (things used to build cleanly for me), but these changes fix them.
As an aside, I don't think that libarrow should have any code that throws exceptions or includes `<exception>` in its public API. I opened ARROW-3017 about addressing that
Author: Wes McKinney <we...@apache.org>
Closes #2399 from wesm/ARROW-2986 and squashes the following commits:
078d10ed <Wes McKinney> Fix clang-format
c5b98f9b <Wes McKinney> Fix compiler warnings seen with Visual Studio Community 2017
---
cpp/cmake_modules/SetupCxxFlags.cmake | 4 +++-
cpp/src/arrow/util/logging.h | 10 ++++++++++
2 files changed, 13 insertions(+), 1 deletion(-)
diff --git a/cpp/cmake_modules/SetupCxxFlags.cmake b/cpp/cmake_modules/SetupCxxFlags.cmake
index 41d2668..73bed04 100644
--- a/cpp/cmake_modules/SetupCxxFlags.cmake
+++ b/cpp/cmake_modules/SetupCxxFlags.cmake
@@ -53,7 +53,9 @@ if (MSVC)
string(REPLACE "/W3" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
# Set desired warning level (e.g. set /W4 for more warnings)
- set(CXX_COMMON_FLAGS "/W3")
+ #
+ # ARROW-2986: Without /EHsc we get C4530 warning
+ set(CXX_COMMON_FLAGS "/W3 /EHsc")
endif()
if (ARROW_USE_STATIC_CRT)
diff --git a/cpp/src/arrow/util/logging.h b/cpp/src/arrow/util/logging.h
index 12defc0..3286146 100644
--- a/cpp/src/arrow/util/logging.h
+++ b/cpp/src/arrow/util/logging.h
@@ -111,6 +111,12 @@ class NullLog {
}
};
+// Do not warn about destructor aborting
+#if defined(_MSC_VER)
+#pragma warning(push)
+#pragma warning(disable : 4722)
+#endif
+
class CerrLog {
public:
CerrLog(int severity) // NOLINT(runtime/explicit)
@@ -154,6 +160,10 @@ class FatalLog : public CerrLog {
}
};
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif
+
} // namespace internal
} // namespace arrow