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

[C++] Compiler warnings with CHECKIN warning level in ORC adapter

    XMLWordPrintableJSON

Details

    Description

      I am encountering this locally with clang 4.0 and BUILD_WARNING_LEVEL=CHECKIN. We should investigate why these aren't showing up in our CI builds

      ../src/arrow/adapters/orc/adapter.cc:138:38: error: implicit conversion loses integer precision: 'uint64_t' (aka 'unsigned long') to 'int32_t' (aka 'int') [-Werror,-Wshorten-64-to-32]
            *out = fixed_size_binary(type->getMaximumLength());
                   ~~~~~~~~~~~~~~~~~ ~~~~~~^~~~~~~~~~~~~~~~~~
      ../src/arrow/adapters/orc/adapter.cc:151:30: error: implicit conversion loses integer precision: 'uint64_t' (aka 'unsigned long') to 'int32_t' (aka 'int') [-Werror,-Wshorten-64-to-32]
              *out = decimal(type->getPrecision(), type->getScale());
                     ~~~~~~~ ~~~~~~^~~~~~~~~~~~~~
      ../src/arrow/adapters/orc/adapter.cc:151:52: error: implicit conversion loses integer precision: 'uint64_t' (aka 'unsigned long') to 'int32_t' (aka 'int') [-Werror,-Wshorten-64-to-32]
              *out = decimal(type->getPrecision(), type->getScale());
                     ~~~~~~~                       ~~~~~~^~~~~~~~~~
      ../src/arrow/adapters/orc/adapter.cc:176:24: error: implicit conversion loses integer precision: 'uint64_t' (aka 'unsigned long') to 'int' [-Werror,-Wshorten-64-to-32]
            int size = type->getSubtypeCount();
                ~~~~   ~~~~~~^~~~~~~~~~~~~~~~~
      ../src/arrow/adapters/orc/adapter.cc:188:24: error: implicit conversion loses integer precision: 'uint64_t' (aka 'unsigned long') to 'int' [-Werror,-Wshorten-64-to-32]
            int size = type->getSubtypeCount();
                ~~~~   ~~~~~~^~~~~~~~~~~~~~~~~
      ../src/arrow/adapters/orc/adapter.cc:262:21: error: implicit conversion loses integer precision: 'uint64_t' (aka 'unsigned long') to 'int' [-Werror,-Wshorten-64-to-32]
          int size = type.getSubtypeCount();
              ~~~~   ~~~~~^~~~~~~~~~~~~~~~~
      ../src/arrow/adapters/orc/adapter.cc:452:18: error: implicit conversion loses integer precision: 'int64_t' (aka 'long') to 'int' [-Werror,-Wshorten-64-to-32]
          for (int i = offset; i < length + offset; i++) {
                   ~   ^~~~~~
      ../src/arrow/adapters/orc/adapter.cc:477:18: error: implicit conversion loses integer precision: 'int64_t' (aka 'long') to 'int' [-Werror,-Wshorten-64-to-32]
          for (int i = offset; i < length + offset; i++) {
                   ~   ^~~~~~
      ../src/arrow/adapters/orc/adapter.cc:543:26: error: implicit conversion loses integer precision: 'int64_t' (aka 'long') to 'int' [-Werror,-Wshorten-64-to-32]
          int start = builder->length();
              ~~~~~   ~~~~~~~~~^~~~~~~~
      ../src/arrow/adapters/orc/adapter.cc:572:26: error: implicit conversion loses integer precision: 'int64_t' (aka 'long') to 'int' [-Werror,-Wshorten-64-to-32]
          int start = builder->length();
              ~~~~~   ~~~~~~~~~^~~~~~~~
      ../src/arrow/adapters/orc/adapter.cc:599:18: error: implicit conversion loses integer precision: 'int64_t' (aka 'long') to 'int' [-Werror,-Wshorten-64-to-32]
          for (int i = offset; i < length + offset; i++) {
                   ~   ^~~~~~
      ../src/arrow/adapters/orc/adapter.cc:615:18: error: implicit conversion loses integer precision: 'int64_t' (aka 'long') to 'int' [-Werror,-Wshorten-64-to-32]
          for (int i = offset; i < length + offset; i++) {
                   ~   ^~~~~~
      ../src/arrow/adapters/orc/adapter.cc:632:20: error: implicit conversion loses integer precision: 'int64_t' (aka 'long') to 'int' [-Werror,-Wshorten-64-to-32]
            for (int i = offset; i < length + offset; i++) {
                     ~   ^~~~~~
      ../src/arrow/adapters/orc/adapter.cc:642:20: error: implicit conversion loses integer precision: 'int64_t' (aka 'long') to 'int' [-Werror,-Wshorten-64-to-32]
            for (int i = offset; i < length + offset; i++) {
                     ~   ^~~~~~
      ../src/arrow/adapters/orc/adapter.cc:519:26: error: implicit conversion loses integer precision: 'int64_t' (aka 'long') to 'int' [-Werror,-Wshorten-64-to-32]
          int start = builder->length();
              ~~~~~   ~~~~~~~~~^~~~~~~~
      ../src/arrow/adapters/orc/adapter.cc:389:16: note: in instantiation of function template specialization 'arrow::adapters::orc::ORCFileReader::Impl::AppendNumericBatchCast<arrow::NumericBuilder<arrow::Int32Type>, int, orc::LongVectorBatch, long>' requested here
              return AppendNumericBatchCast<Int32Builder, int32_t, liborc::LongVectorBatch,
                     ^
      ../src/arrow/adapters/orc/adapter.cc:519:26: error: implicit conversion loses integer precision: 'int64_t' (aka 'long') to 'int' [-Werror,-Wshorten-64-to-32]
          int start = builder->length();
              ~~~~~   ~~~~~~~~~^~~~~~~~
      ../src/arrow/adapters/orc/adapter.cc:392:16: note: in instantiation of function template specialization 'arrow::adapters::orc::ORCFileReader::Impl::AppendNumericBatchCast<arrow::NumericBuilder<arrow::Int16Type>, short, orc::LongVectorBatch, long>' requested here
              return AppendNumericBatchCast<Int16Builder, int16_t, liborc::LongVectorBatch,
                     ^
      ../src/arrow/adapters/orc/adapter.cc:519:26: error: implicit conversion loses integer precision: 'int64_t' (aka 'long') to 'int' [-Werror,-Wshorten-64-to-32]
          int start = builder->length();
              ~~~~~   ~~~~~~~~~^~~~~~~~
      ../src/arrow/adapters/orc/adapter.cc:395:16: note: in instantiation of function template specialization 'arrow::adapters::orc::ORCFileReader::Impl::AppendNumericBatchCast<arrow::NumericBuilder<arrow::Int8Type>, signed char, orc::LongVectorBatch, long>' requested here
              return AppendNumericBatchCast<Int8Builder, int8_t, liborc::LongVectorBatch,
                     ^
      ../src/arrow/adapters/orc/adapter.cc:519:26: error: implicit conversion loses integer precision: 'int64_t' (aka 'long') to 'int' [-Werror,-Wshorten-64-to-32]
          int start = builder->length();
              ~~~~~   ~~~~~~~~~^~~~~~~~
      ../src/arrow/adapters/orc/adapter.cc:401:16: note: in instantiation of function template specialization 'arrow::adapters::orc::ORCFileReader::Impl::AppendNumericBatchCast<arrow::NumericBuilder<arrow::FloatType>, float, orc::DoubleVectorBatch, double>' requested here
              return AppendNumericBatchCast<FloatBuilder, float, liborc::DoubleVectorBatch,
                     ^
      ../src/arrow/adapters/orc/adapter.cc:599:18: error: implicit conversion loses integer precision: 'int64_t' (aka 'long') to 'int' [-Werror,-Wshorten-64-to-32]
          for (int i = offset; i < length + offset; i++) {
                   ~   ^~~~~~
      ../src/arrow/adapters/orc/adapter.cc:407:16: note: in instantiation of function template specialization 'arrow::adapters::orc::ORCFileReader::Impl::AppendBinaryBatch<arrow::StringBuilder>' requested here
              return AppendBinaryBatch<StringBuilder>(batch, offset, length, builder);
                     ^
      fatal error: too many errors emitted, stopping now [-ferror-limit=]
      20 errors generated.
      

      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: