Uploaded image for project: 'Apache Arrow'
  1. Apache Arrow
  2. ARROW-4346

[C++] Fix compiler warnings with gcc 8.2.0

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 0.13.0
    • C++

    Description

      I just set up a new machine on Ubuntu 18.10 so I'm getting a few papercuts

      /usr/bin/ccache /usr/bin/c++  -DARROW_EXTRA_ERROR_CONTEXT -DARROW_JEMALLOC -DARROW_JEMALLOC_INCLUDE_DIR=/home/wesm/code/arrow/cpp/build/jemalloc_ep-prefix/src/jemalloc_ep/dist//include -DARROW_NO_DEPRECATED_API -DARROW_USE_GLOG -DARROW_USE_SIMD -DARROW_WITH_ZSTD -Isrc -I../src -isystem /home/wesm/cpp-toolchain/include -isystem gbenchmark_ep/src/gbenchmark_ep-install/include -isystem jemalloc_ep-prefix/src -isystem ../thirdparty/hadoop/include -isystem orc_ep-install/include -isystem /home/wesm/cpp-toolchain/include/thrift -Wno-noexcept-type  -fuse-ld=gold -ggdb -O0  -Wall -Wconversion -Wno-sign-conversion -Werror -msse4.2  -g -fPIE   -std=gnu++11 -MD -MT src/parquet/CMakeFiles/parquet-encoding-benchmark.dir/encoding-benchmark.cc.o -MF src/parquet/CMakeFiles/parquet-encoding-benchmark.dir/encoding-benchmark.cc.o.d -o src/parquet/CMakeFiles/parquet-encoding-benchmark.dir/encoding-benchmark.cc.o -c ../src/parquet/encoding-benchmark.cc
      In file included from ../src/parquet/encoding-internal.h:33,
                       from ../src/parquet/encoding-benchmark.cc:20:
      ../src/parquet/encoding.h: In instantiation of ‘int parquet::Decoder<DType>::DecodeSpaced(parquet::Decoder<DType>::T*, int, int, const uint8_t*, int64_t) [with DType = parquet::DataType<(parquet::Type::type)6>; parquet::Decoder<DType>::T = parquet::ByteArray; uint8_t = unsigned char; int64_t = long int]’:
      ../src/parquet/encoding.h:110:15:   required from here
      ../src/parquet/encoding.h:120:11: error: ‘void* memset(void*, int, size_t)’ clearing an object of non-trivial type ‘parquet::Decoder<parquet::DataType<(parquet::Type::type)6> >::T’ {aka ‘struct parquet::ByteArray’}; use assignment or value-initialization instead [-Werror=class-memaccess]
           memset(buffer + values_read, 0, (num_values - values_read) * sizeof(T));
           ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      In file included from ../src/parquet/schema.h:31,
                       from ../src/parquet/encoding.h:29,
                       from ../src/parquet/encoding-internal.h:33,
                       from ../src/parquet/encoding-benchmark.cc:20:
      ../src/parquet/types.h:155:8: note: ‘parquet::Decoder<parquet::DataType<(parquet::Type::type)6> >::T’ {aka ‘struct parquet::ByteArray’} declared here
       struct ByteArray {
              ^~~~~~~~~
      cc1plus: all warnings being treated as errors
      

      Attachments

        Issue Links

          Activity

            People

              wesm Wes McKinney
              wesm Wes McKinney
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 20m
                  20m