google / google/j2objc

Error to generate binary

Open
#2,697 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
Java
Stars
6k
Forks
999
Avg merge
19h 20m
Merged PRs (30d)
14

Description

I tried to generate the binary and when I run `make dist`, I get this error.

/j2objc/jre_emul/build_result/Classes/java/util/Hashtable.m:497:124: error:
implicit conversion from 'int' to 'float' changes value from 2147483640 to 2147483648
[-Werror,-Wimplicit-const-int-float-conversion]
497 | threshold_ = JreFpToInt(JavaLangMath_minWithFloat_withFloat_(newCapacity * loadFactor_, JavaUtilHashtable_MAX_ARRAY_SIZE + 1));
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
/j2objc/jre_emul/build_result/Classes/java/util/Hashtable.m:1041:119: error:
implicit conversion from 'int' to 'float' changes value from 2147483640 to 2147483648
[-Werror,-Wimplicit-const-int-float-conversion]
1041 | threshold_ = JreFpToInt(JavaLangMath_minWithFloat_withFloat_(length * loadFactor_, JavaUtilHashtable_MAX_ARRAY_SIZE + 1));
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
2 errors generated.

Is there anything else I need to do? How do I resolve this int to float conversion error?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.