You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@arrow.apache.org by "Neal Richardson (Jira)" <ji...@apache.org> on 2020/07/07 17:10:00 UTC

[jira] [Created] (ARROW-9355) [R] Fix -Wimplicit-int-float-conversion

Neal Richardson created ARROW-9355:
--------------------------------------

             Summary: [R] Fix -Wimplicit-int-float-conversion
                 Key: ARROW-9355
                 URL: https://issues.apache.org/jira/browse/ARROW-9355
             Project: Apache Arrow
          Issue Type: Bug
          Components: R
            Reporter: Neal Richardson
            Assignee: Romain Francois
             Fix For: 1.0.0


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

{code}
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.
{code}

Presumably this is fixable with an explicit cast?



--
This message was sent by Atlassian Jira
(v8.3.4#803005)