This is an automated email from the ASF dual-hosted git repository.
kou pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow.git
The following commit(s) were added to refs/heads/main by this push:
new 349d232d85 GH-47099: [C++][Parquet] Add missing `pragma warning(pop)`
to `parquet/platform.h` (#47114)
349d232d85 is described below
commit 349d232d856126f2aa0d3b7b799dfa3e3c09e699
Author: Michael Behrisch <[email protected]>
AuthorDate: Mon Oct 13 00:48:18 2025 +0200
GH-47099: [C++][Parquet] Add missing `pragma warning(pop)` to
`parquet/platform.h` (#47114)
### Rationale for this change
The missing pragma is causing warnings downstream see #47099
### What changes are included in this PR?
* Add the missing `pragma warning(pop)`
* Use `pragma warning(disable : 4250)` explicitly in other `.cc`/`.h`
* Add missing `PARQUET_EXPORT`
### Are these changes tested?
Yes.
### Are there any user-facing changes?
The developer should see less warnings otherwise, no.
* GitHub Issue: #47099
Authored-by: Michael Behrisch <[email protected]>
Signed-off-by: Sutou Kouhei <[email protected]>
---
cpp/src/parquet/column_reader.cc | 5 +++++
cpp/src/parquet/decoder.cc | 5 +++++
cpp/src/parquet/encoder.cc | 5 +++++
cpp/src/parquet/exception.h | 19 ++++++++++++++++++-
cpp/src/parquet/hasher.h | 2 +-
cpp/src/parquet/platform.h | 6 +++++-
cpp/src/parquet/types.cc | 5 +++++
7 files changed, 44 insertions(+), 3 deletions(-)
diff --git a/cpp/src/parquet/column_reader.cc b/cpp/src/parquet/column_reader.cc
index 9c314cf818..8ecb774022 100644
--- a/cpp/src/parquet/column_reader.cc
+++ b/cpp/src/parquet/column_reader.cc
@@ -57,6 +57,11 @@
#include "parquet/thrift_internal.h" // IWYU pragma: keep
#include "parquet/windows_fixup.h" // for OPTIONAL
+#ifdef _MSC_VER
+// disable warning about inheritance via dominance in the diamond pattern
+# pragma warning(disable : 4250)
+#endif
+
using arrow::MemoryPool;
using arrow::internal::AddWithOverflow;
using arrow::internal::checked_cast;
diff --git a/cpp/src/parquet/decoder.cc b/cpp/src/parquet/decoder.cc
index b6d7966562..d0a857dd22 100644
--- a/cpp/src/parquet/decoder.cc
+++ b/cpp/src/parquet/decoder.cc
@@ -53,6 +53,11 @@
#include "parquet/schema.h"
#include "parquet/types.h"
+#ifdef _MSC_VER
+// disable warning about inheritance via dominance in the diamond pattern
+# pragma warning(disable : 4250)
+#endif
+
namespace bit_util = arrow::bit_util;
using arrow::Status;
diff --git a/cpp/src/parquet/encoder.cc b/cpp/src/parquet/encoder.cc
index 831ddbddab..f9367555d9 100644
--- a/cpp/src/parquet/encoder.cc
+++ b/cpp/src/parquet/encoder.cc
@@ -49,6 +49,11 @@
#include "parquet/schema.h"
#include "parquet/types.h"
+#ifdef _MSC_VER
+// disable warning about inheritance via dominance in the diamond pattern
+# pragma warning(disable : 4250)
+#endif
+
namespace bit_util = arrow::bit_util;
using arrow::Status;
diff --git a/cpp/src/parquet/exception.h b/cpp/src/parquet/exception.h
index 46f5595dd1..5c6c9ce8a7 100644
--- a/cpp/src/parquet/exception.h
+++ b/cpp/src/parquet/exception.h
@@ -26,6 +26,19 @@
#include "arrow/util/string_util.h"
#include "parquet/platform.h"
+#ifdef _MSC_VER
+# pragma warning(push)
+// Disable warning for STL types usage in DLL interface
+//
https://web.archive.org/web/20130317015847/http://connect.microsoft.com/VisualStudio/feedback/details/696593/vc-10-vs-2010-basic-string-exports
+# pragma warning(disable : 4275 4251)
+// Disable diamond inheritance warnings
+# pragma warning(disable : 4250)
+// Disable macro redefinition warnings
+# pragma warning(disable : 4005)
+// Disable extern before exported template warnings
+# pragma warning(disable : 4910)
+#endif
+
// PARQUET-1085
#if !defined(ARROW_UNUSED)
# define ARROW_UNUSED(x) UNUSED(x)
@@ -84,7 +97,7 @@
namespace parquet {
-class ParquetException : public std::exception {
+class PARQUET_EXPORT ParquetException : public std::exception {
public:
PARQUET_NORETURN static void EofException(const std::string& msg = "") {
static std::string prefix = "Unexpected end of stream";
@@ -156,3 +169,7 @@ void ThrowNotOk(StatusReturnBlock&& b) {
}
} // namespace parquet
+
+#ifdef _MSC_VER
+# pragma warning(pop)
+#endif
diff --git a/cpp/src/parquet/hasher.h b/cpp/src/parquet/hasher.h
index 519eb459b9..9ff41f17b5 100644
--- a/cpp/src/parquet/hasher.h
+++ b/cpp/src/parquet/hasher.h
@@ -22,7 +22,7 @@
namespace parquet {
// Abstract class for hash
-class Hasher {
+class PARQUET_EXPORT Hasher {
public:
/// Compute hash for 32 bits value by using its plain encoding result.
///
diff --git a/cpp/src/parquet/platform.h b/cpp/src/parquet/platform.h
index e8d67e225f..92849347d4 100644
--- a/cpp/src/parquet/platform.h
+++ b/cpp/src/parquet/platform.h
@@ -28,7 +28,7 @@
#if defined(_WIN32) || defined(__CYGWIN__)
-# if defined(_MSC_VER)
+# ifdef _MSC_VER
# pragma warning(push)
// Disable warning for STL types usage in DLL interface
//
https://web.archive.org/web/20130317015847/http://connect.microsoft.com/VisualStudio/feedback/details/696593/vc-10-vs-2010-basic-string-exports
@@ -110,3 +110,7 @@ std::shared_ptr<ResizableBuffer> AllocateBuffer(
::arrow::MemoryPool* pool = ::arrow::default_memory_pool(), int64_t size =
0);
} // namespace parquet
+
+#ifdef _MSC_VER
+# pragma warning(pop)
+#endif
diff --git a/cpp/src/parquet/types.cc b/cpp/src/parquet/types.cc
index 9f5003b79e..7109c3d1c8 100644
--- a/cpp/src/parquet/types.cc
+++ b/cpp/src/parquet/types.cc
@@ -39,6 +39,11 @@
#include "generated/parquet_types.h"
+#ifdef _MSC_VER
+// disable warning about inheritance via dominance in the diamond pattern
+# pragma warning(disable : 4250)
+#endif
+
using arrow::internal::checked_cast;
using arrow::util::Codec;