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 2020/05/20 23:13:54 UTC

[arrow] branch master updated: PARQUET-1865: [C++] Fix usages of C++17 extensions in parquet/encoding_benchmark.cc

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 07160a8  PARQUET-1865: [C++] Fix usages of C++17 extensions in parquet/encoding_benchmark.cc
07160a8 is described below

commit 07160a8ed0213a17ff804274a7d02be498247683
Author: Wes McKinney <we...@apache.org>
AuthorDate: Wed May 20 18:13:21 2020 -0500

    PARQUET-1865: [C++] Fix usages of C++17 extensions in parquet/encoding_benchmark.cc
    
    Compilation was failing for me with clang-8 with the following warning
    
    ```
    ../src/parquet/encoding_benchmark.cc:286:53: error: static_assert with
    no message is a C++17 extension [-Werror,-Wc++17-extensions]
      static_assert(sizeof(CType) == sizeof(*raw_values));
    ```
    
    Closes #7237 from wesm/PARQUET-1865
    
    Authored-by: Wes McKinney <we...@apache.org>
    Signed-off-by: Wes McKinney <we...@apache.org>
---
 cpp/src/parquet/encoding_benchmark.cc | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/cpp/src/parquet/encoding_benchmark.cc b/cpp/src/parquet/encoding_benchmark.cc
index ef97d10..1101e38 100644
--- a/cpp/src/parquet/encoding_benchmark.cc
+++ b/cpp/src/parquet/encoding_benchmark.cc
@@ -239,7 +239,7 @@ static void BM_PlainEncodingSpaced(benchmark::State& state) {
   const auto array_actual = arrow::internal::checked_pointer_cast<ArrayType>(array);
   const auto raw_values = array_actual->raw_values();
   // Guarantee the type cast between raw_values and input of PutSpaced.
-  static_assert(sizeof(CType) == sizeof(*raw_values));
+  static_assert(sizeof(CType) == sizeof(*raw_values), "Type mismatch");
   // Cast only happens for BooleanType as it use UInt8 for the array data to match a bool*
   // input to PutSpaced.
   const auto src = reinterpret_cast<const CType*>(raw_values);
@@ -283,7 +283,7 @@ static void BM_PlainDecodingSpaced(benchmark::State& state) {
   const auto array_actual = arrow::internal::checked_pointer_cast<ArrayType>(array);
   const auto raw_values = array_actual->raw_values();
   // Guarantee the type cast between raw_values and input of PutSpaced.
-  static_assert(sizeof(CType) == sizeof(*raw_values));
+  static_assert(sizeof(CType) == sizeof(*raw_values), "Type mismatch");
   // Cast only happens for BooleanType as it use UInt8 for the array data to match a bool*
   // input to PutSpaced.
   const auto src = reinterpret_cast<const CType*>(raw_values);