This is an automated email from the ASF dual-hosted git repository.

lidavidm 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 7adda73dc4 ARROW-16643: [C++] Fix warnings for clang-14
7adda73dc4 is described below

commit 7adda73dc4ef6f28f8e5701eb4be1dc9526c0e1b
Author: Wes McKinney <[email protected]>
AuthorDate: Tue May 24 14:54:49 2022 -0400

    ARROW-16643: [C++] Fix warnings for clang-14
    
    The following code in arrow/util/small_vector_benchmark.cc generates 
`-Wreturn-stack-address` in clang-14. It might be better to fix but suppressing 
for now:
    
    ```
    template <typename Vector>
    ARROW_NOINLINE int64_t ConsumeVector(Vector v) {
      return reinterpret_cast<intptr_t>(v.data());
    }
    
    template <typename Vector>
    ARROW_NOINLINE int64_t IngestVector(const Vector& v) {
      return reinterpret_cast<intptr_t>(v.data());
    }
    ```
    
    Closes #13225 from wesm/ARROW-16643
    
    Authored-by: Wes McKinney <[email protected]>
    Signed-off-by: David Li <[email protected]>
---
 cpp/cmake_modules/SetupCxxFlags.cmake    | 1 +
 cpp/src/arrow/flight/flight_benchmark.cc | 2 +-
 cpp/src/parquet/column_io_benchmark.cc   | 2 +-
 3 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/cpp/cmake_modules/SetupCxxFlags.cmake 
b/cpp/cmake_modules/SetupCxxFlags.cmake
index a11f37dd4d..d3a2a1a2d2 100644
--- a/cpp/cmake_modules/SetupCxxFlags.cmake
+++ b/cpp/cmake_modules/SetupCxxFlags.cmake
@@ -286,6 +286,7 @@ if("${BUILD_WARNING_LEVEL}" STREQUAL "CHECKIN")
     set(CXX_COMMON_FLAGS "${CXX_COMMON_FLAGS} -Wno-missing-braces")
     set(CXX_COMMON_FLAGS "${CXX_COMMON_FLAGS} -Wno-unused-parameter")
     set(CXX_COMMON_FLAGS "${CXX_COMMON_FLAGS} -Wno-constant-logical-operand")
+    set(CXX_COMMON_FLAGS "${CXX_COMMON_FLAGS} -Wno-return-stack-address")
   elseif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
     set(CXX_COMMON_FLAGS "${CXX_COMMON_FLAGS} -Wall")
     set(CXX_COMMON_FLAGS "${CXX_COMMON_FLAGS} -Wno-conversion")
diff --git a/cpp/src/arrow/flight/flight_benchmark.cc 
b/cpp/src/arrow/flight/flight_benchmark.cc
index fa0cc9a3d5..f53b1c6dce 100644
--- a/cpp/src/arrow/flight/flight_benchmark.cc
+++ b/cpp/src/arrow/flight/flight_benchmark.cc
@@ -230,7 +230,7 @@ arrow::Result<std::vector<SizedBatch>> GetPutData(const 
perf::Token& token) {
   int64_t records_sent = 0;
   while (records_sent < total_records) {
     if (records_sent + length > total_records) {
-      const int last_length = total_records - records_sent;
+      const int64_t last_length = total_records - records_sent;
       // Hard-coded
       batches.push_back(SizedBatch{batch->Slice(0, last_length),
                                    /*bytes=*/last_length * bytes_per_record});
diff --git a/cpp/src/parquet/column_io_benchmark.cc 
b/cpp/src/parquet/column_io_benchmark.cc
index e3e98edfd5..6ee579bec9 100644
--- a/cpp/src/parquet/column_io_benchmark.cc
+++ b/cpp/src/parquet/column_io_benchmark.cc
@@ -61,7 +61,7 @@ void SetBytesProcessed(::benchmark::State& state, 
Repetition::type repetition) {
   if (repetition == Repetition::REPEATED) {
     bytes_processed += state.iterations() * state.range(0) * sizeof(int16_t);
   }
-  state.SetBytesProcessed(state.iterations() * state.range(0) * 
sizeof(int16_t));
+  state.SetBytesProcessed(bytes_processed);
 }
 
 template <Repetition::type repetition,

Reply via email to