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

[C++] Conversion warnings in cast.cc #19592

Closed
asfimport opened this issue Sep 17, 2018 · 1 comment
Closed

[C++] Conversion warnings in cast.cc #19592

asfimport opened this issue Sep 17, 2018 · 1 comment
Assignees
Milestone

Comments

@asfimport
Copy link

This is with gcc 7.3.0 and -Wconversion.

../src/arrow/compute/kernels/cast.cc: In instantiation ofvoid arrow::compute::CastFunctor<O, I, typename std::enable_if<arrow::compute::is_float_truncate<O, I>::value>::type>::operator()(arrow::compute::FunctionContext*, const arrow::compute::CastOptions&, const arrow::ArrayData&, arrow::ArrayData*) [with O = arrow::Int64Type; I = arrow::DoubleType; typename std::enable_if<arrow::compute::is_float_truncate<O, I>::value>::type = void]’:
../src/arrow/compute/kernels/cast.cc:1105:1:   required from here
../src/arrow/compute/kernels/cast.cc:291:45: warning: conversion toin_type {aka double}’ from ‘long int’ may alter its value [-Wconversion]
           if (ARROW_PREDICT_FALSE(out_value != *in_data)) {
                                   ~~~~~~~~~~^~~~~
../src/arrow/util/macros.h:37:50: note: in definition of macroARROW_PREDICT_FALSE’
 #define ARROW_PREDICT_FALSE(x) (__builtin_expect(x, 0))
                                                  ^
../src/arrow/compute/kernels/cast.cc:301:45: warning: conversion toin_type {aka double}’ from ‘long int’ may alter its value [-Wconversion]
           if (ARROW_PREDICT_FALSE(out_value != *in_data)) {
                                   ~~~~~~~~~~^~~~~
../src/arrow/util/macros.h:37:50: note: in definition of macroARROW_PREDICT_FALSE’
 #define ARROW_PREDICT_FALSE(x) (__builtin_expect(x, 0))

Reporter: Antoine Pitrou / @pitrou
Assignee: Antoine Pitrou / @pitrou

PRs and other links:

Note: This issue was originally created as ARROW-3251. Please see the migration documentation for further details.

@asfimport
Copy link
Author

Wes McKinney / @wesm:
Issue resolved by pull request 2575
#2575

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants