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

[R] Fix -Wimplicit-int-float-conversion

Agile BoardAttach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 1.0.0
    • R

    Description

      https://www.r-project.org/nosvn/R.check/r-devel-linux-x86_64-fedora-clang/arrow-00install.html

      array_from_vector.cpp:332:53: warning: implicit conversion from 'std::__1::numeric_limits<long>::type' (aka 'long') to 'double' changes value from 9223372036854775807 to 9223372036854775808 [-Wimplicit-int-float-conversion]
        if (x < std::numeric_limits<Target>::min() || x > std::numeric_limits<Target>::max()) {
                                                        ~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      array_from_vector.cpp:483:33: note: in instantiation of function template specialization 'arrow::internal::int_cast<double, long, 0>' requested here
              RETURN_NOT_OK(internal::int_cast(*p, &value));
                                      ^
      array_from_vector.cpp:463:16: note: in instantiation of function template specialization 'arrow::r::Unbox<arrow::Int64Type, void>::IngestRange<double>' requested here
              return IngestRange(builder, REAL(obj), XLENGTH(obj));
                     ^
      array_from_vector.cpp:724:58: note: in instantiation of member function 'arrow::r::Unbox<arrow::Int64Type, void>::Ingest' requested here
        Status Ingest(SEXP obj) override { return Unbox<Type>::Ingest(typed_builder_, obj); }
                                                               ^
      array_from_vector.cpp:879:5: note: in instantiation of member function 'arrow::r::TypedVectorConverter<arrow::Int64Type, arrow::r::NumericVectorConverter<arrow::Int64Type> >::Ingest' requested here
          NUMERIC_CONVERTER(INT64, Int64Type);
          ^
      array_from_vector.cpp:858:59: note: expanded from macro 'NUMERIC_CONVERTER'
              std::unique_ptr<NumericVectorConverter<TYPE>>(new NumericVectorConverter<TYPE>); \
                                                                ^
      1 warning generated.
      

      Presumably this is fixable with an explicit cast?

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            romainfrancois Romain Francois Assign to me
            npr Neal Richardson
            Votes:
            0 Vote for this issue
            Watchers:
            1 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 - 50m
                50m

                Slack

                  Issue deployment