diff options
author | Nick Desaulniers <ndesaulniers@google.com> | 2019-10-16 10:02:23 -0700 |
---|---|---|
committer | Treehugger Robot <treehugger-gerrit@google.com> | 2019-10-17 13:26:49 +0000 |
commit | 706e778ef7a84ddfef82e8e2e43f852960849935 (patch) | |
tree | 46a213bcc6926956298275629aa2b42eeebc0ed1 /test/MultiDex | |
parent | 352482c000830755405f5da3624891ff4690a36a (diff) |
[art] fix -Wimplicit-int-float-conversion
kPrimIntMax and kPrimLongMax are too large in value to be precisely
represented by IEEE 754 single and double precision, respectively.
The code in question is clamping the `value` to the above kConstants.
In this case, the imprecision doesn't result in logical errors. Accept
the imprecision via explicit cast.
Fixes:
art/compiler/optimizing/nodes.cc:1597:22: error: implicit conversion
from 'const int32_t' (aka 'const int') to 'float' changes value from
2147483647 to 2147483648 [-Werror,-Wimplicit-int-float-conversion]
if (value >= kPrimIntMax)
~~ ^~~~~~~~~~~
art/compiler/optimizing/nodes.cc:1605:22: error: implicit conversion
from 'const int64_t' (aka 'const long') to 'float' changes value from
9223372036854775807 to 9223372036854775808
[-Werror,-Wimplicit-int-float-conversion]
if (value >= kPrimLongMax)
~~ ^~~~~~~~~~~~
art/compiler/optimizing/nodes.cc:1629:22: error: implicit conversion
from 'const int64_t' (aka 'const long') to 'double' changes value from
9223372036854775807 to 9223372036854775808
[-Werror,-Wimplicit-int-float-conversion]
if (value >= kPrimLongMax)
~~ ^~~~~~~~~~~~
Bug: 139945549
Test: mm
Change-Id: I60582c13cfaceb6c6b217e13d7e9bd04d94874fe
Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
Diffstat (limited to 'test/MultiDex')
0 files changed, 0 insertions, 0 deletions