You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by fs...@apache.org on 2019/08/05 16:57:09 UTC

[arrow] branch master updated: ARROW-6128: [C++] Suppress a class-memaccess warning

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

fsaintjacques 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 456a8d5  ARROW-6128: [C++] Suppress a class-memaccess warning
456a8d5 is described below

commit 456a8d5683b9cec19daabdffb480f2451b00bd64
Author: Sutou Kouhei <ko...@clear-code.com>
AuthorDate: Mon Aug 5 12:56:55 2019 -0400

    ARROW-6128: [C++] Suppress a class-memaccess warning
    
        src/arrow/util/hashing.h:313:11: error: 'void* memset(void*, int, size_t)' clearing an object of non-trivial type 'struct arrow::internal::HashTable<arrow::internal::ScalarMemoTable<nonstd::sv_lite::basic_string_view<char>, arrow::internal::HashTable>::Payload>::Entry'; use assignment or value-initialization instead [-Werror=class-memaccess]
             memset(entries_, 0, capacity * sizeof(Entry));
             ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        src/arrow/util/hashing.h:197:10: note: 'struct arrow::internal::HashTable<arrow::internal::ScalarMemoTable<nonstd::sv_lite::basic_string_view<char>, arrow::internal::HashTable>::Payload>::Entry' declared here
           struct Entry {
                  ^~~~~
    
    Closes #5001 from kou/cpp-add-missing-void-star-cast and squashes the following commits:
    
    9ee6eb0f8 <Sutou Kouhei>  Suppress a class-memaccess warning
    
    Authored-by: Sutou Kouhei <ko...@clear-code.com>
    Signed-off-by: François Saint-Jacques <fs...@gmail.com>
---
 cpp/src/arrow/util/hashing.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/cpp/src/arrow/util/hashing.h b/cpp/src/arrow/util/hashing.h
index b4b5a88..e6fdbb5 100644
--- a/cpp/src/arrow/util/hashing.h
+++ b/cpp/src/arrow/util/hashing.h
@@ -310,7 +310,7 @@ class HashTable {
   Status UpsizeBuffer(uint64_t capacity) {
     RETURN_NOT_OK(entries_builder_.Resize(capacity));
     entries_ = entries_builder_.mutable_data();
-    memset(entries_, 0, capacity * sizeof(Entry));
+    memset(static_cast<void*>(entries_), 0, capacity * sizeof(Entry));
 
     return Status::OK();
   }