You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Go's int type size is platform dependent.
Java's int type is always 32bit.
Gobind currently maps 'int' to 'long' type to have a consistent api while dealing with 64bit values that may return from Go.
On 32bit platform this can be problematic if the Java API passes larger than the 32bit int max. Generating a different API depending on the platform is not an option, but we need a way to limit the value that can be passed into Go depending on the platform.
The text was updated successfully, but these errors were encountered:
@dr2chase, gomobile binds an existing Go API, so unless we ban the use of ints in bound packages, we can't avoid them.
@hyangah, I'm not sure what needs to be done for this issue to be fixed. Calling Go from Java on 32 bit platforms truncates ints larger than the 32 bit maximum. That is unfortunate but what would you prefer instead? A runtime error, or something else?
@eliasnaur I think the best option for this bug is to mark it as unfixable. When a user decides to use int in the API, the user did so because on 32bit platform, 32bit integer is sufficient for their API.
Go's int type size is platform dependent.
Java's int type is always 32bit.
Gobind currently maps 'int' to 'long' type to have a consistent api while dealing with 64bit values that may return from Go.
On 32bit platform this can be problematic if the Java API passes larger than the 32bit int max. Generating a different API depending on the platform is not an option, but we need a way to limit the value that can be passed into Go depending on the platform.
The text was updated successfully, but these errors were encountered: