Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ARROW-6735: [C++] Suppress sign-compare warning with g++ 9.2.1 #5541

Closed
wants to merge 1 commit into from

Conversation

kou
Copy link
Member

@kou kou commented Sep 29, 2019

This was introduced by ARROW-6402 #5244 but removed accidentally by
ARROW-5935 #4930.

In file included from ../src/arrow/status.h:24,
                 from ../src/arrow/memory_pool.h:26,
                 from ../src/arrow/buffer.h:28,
                 from ../src/arrow/array.h:28,
                 from ../src/arrow/array/builder_union.h:25,
                 from ../src/arrow/array/builder_union.cc:18:
../src/arrow/array/builder_union.cc: In constructor 'arrow::BasicUnionBuilder::BasicUnionBuilder(arrow::MemoryPool*, arrow::UnionMode::type, const std::vector<std::shared_ptr<arrow::ArrayBuilder> >&, const std::shared_ptr<arrow::DataType>&)':
../src/arrow/util/logging.h:86:55: error: comparison of integer expressions of different signedness: 'std::vector<arrow::ArrayBuilder*>::size_type' {aka 'long unsigned int'} and 'signed char' [-Werror=sign-compare]
   86 | #define ARROW_CHECK_LT(val1, val2) ARROW_CHECK((val1) < (val2))
      |                                                ~~~~~~~^~~~~~~~
../src/arrow/util/macros.h:43:52: note: in definition of macro 'ARROW_PREDICT_TRUE'
   43 | #define ARROW_PREDICT_TRUE(x) (__builtin_expect(!!(x), 1))
      |                                                    ^
../src/arrow/util/logging.h:86:36: note: in expansion of macro 'ARROW_CHECK'
   86 | #define ARROW_CHECK_LT(val1, val2) ARROW_CHECK((val1) < (val2))
      |                                    ^~~~~~~~~~~
../src/arrow/util/logging.h:135:19: note: in expansion of macro 'ARROW_CHECK_LT'
  135 | #define DCHECK_LT ARROW_CHECK_LT
      |                   ^~~~~~~~~~~~~~
../src/arrow/array/builder_union.cc:63:3: note: in expansion of macro 'DCHECK_LT'
   63 |   DCHECK_LT(type_id_to_children_.size(), std::numeric_limits<int8_t>::max());
      |   ^~~~~~~~~

This was introduced by ARROW-6402 apache#5244 but removed accidentally by
ARROW-5935 apache#4930.

    In file included from ../src/arrow/status.h:24,
                     from ../src/arrow/memory_pool.h:26,
                     from ../src/arrow/buffer.h:28,
                     from ../src/arrow/array.h:28,
                     from ../src/arrow/array/builder_union.h:25,
                     from ../src/arrow/array/builder_union.cc:18:
    ../src/arrow/array/builder_union.cc: In constructor 'arrow::BasicUnionBuilder::BasicUnionBuilder(arrow::MemoryPool*, arrow::UnionMode::type, const std::vector<std::shared_ptr<arrow::ArrayBuilder> >&, const std::shared_ptr<arrow::DataType>&)':
    ../src/arrow/util/logging.h:86:55: error: comparison of integer expressions of different signedness: 'std::vector<arrow::ArrayBuilder*>::size_type' {aka 'long unsigned int'} and 'signed char' [-Werror=sign-compare]
       86 | #define ARROW_CHECK_LT(val1, val2) ARROW_CHECK((val1) < (val2))
          |                                                ~~~~~~~^~~~~~~~
    ../src/arrow/util/macros.h:43:52: note: in definition of macro 'ARROW_PREDICT_TRUE'
       43 | #define ARROW_PREDICT_TRUE(x) (__builtin_expect(!!(x), 1))
          |                                                    ^
    ../src/arrow/util/logging.h:86:36: note: in expansion of macro 'ARROW_CHECK'
       86 | #define ARROW_CHECK_LT(val1, val2) ARROW_CHECK((val1) < (val2))
          |                                    ^~~~~~~~~~~
    ../src/arrow/util/logging.h:135:19: note: in expansion of macro 'ARROW_CHECK_LT'
      135 | #define DCHECK_LT ARROW_CHECK_LT
          |                   ^~~~~~~~~~~~~~
    ../src/arrow/array/builder_union.cc:63:3: note: in expansion of macro 'DCHECK_LT'
       63 |   DCHECK_LT(type_id_to_children_.size(), std::numeric_limits<int8_t>::max());
          |   ^~~~~~~~~
@github-actions
Copy link

@codecov-io
Copy link

Codecov Report

Merging #5541 into master will increase coverage by 21.29%.
The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff             @@
##           master    #5541       +/-   ##
===========================================
+ Coverage   67.91%   89.21%   +21.29%     
===========================================
  Files         600      773      +173     
  Lines       79093   113069    +33976     
===========================================
+ Hits        53718   100874    +47156     
+ Misses      25021    12195    -12826     
+ Partials      354        0      -354
Impacted Files Coverage Δ
cpp/src/arrow/array/builder_union.cc 97.91% <100%> (ø) ⬆️
cpp/src/arrow/testing/gtest_util.h 97.36% <0%> (-2.64%) ⬇️
cpp/src/arrow/compute/kernel.h 60.57% <0%> (-2.11%) ⬇️
cpp/src/plasma/thirdparty/ae/ae.c 70.75% <0%> (-0.95%) ⬇️
cpp/src/arrow/result.h 91.3% <0%> (-0.37%) ⬇️
cpp/src/arrow/table.h 100% <0%> (ø) ⬆️
cpp/src/arrow/flight/server.h 100% <0%> (ø) ⬆️
cpp/src/arrow/table_builder.h 100% <0%> (ø) ⬆️
cpp/src/plasma/plasma.h 100% <0%> (ø) ⬆️
cpp/src/arrow/flight/types.h 100% <0%> (ø) ⬆️
... and 605 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5fec051...2094cca. Read the comment docs.

Copy link
Member

@pitrou pitrou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

@pitrou pitrou closed this in 7128d97 Sep 30, 2019
@kou kou deleted the cpp-suppress-warning-with-g++-9.2.1 branch September 30, 2019 21:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants