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

Convert from int32 for large integer literals in bitv.ml #126

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

TyOverby
Copy link

When the ocaml compiler emits bytecode for 32-bit architectures, large interger literals will cause it to fail. 32-bit marshalling is most commonly used when compiling with the Js_of_ocaml backend.

This error message is what you'd see when attempting to use ocamlgraph in a JSOO project:

----line 1 of _none_ col 1
File "_none_", line 1:
Error: Generated bytecode library "graph.cma" cannot be used on a 32-bit platform

By using 32-bit integer literals, we avoid the issue by eschewing platform-native integers.

When the ocaml compiler emits bytecode for 32-bit architectures, large interger literals will cause it to fail.  32-bit marshalling is most commonly used when compiling with the Js_of_ocaml backend. 

This error message is what you'd see when attempting to use ocamlgraph in a JSOO project: 
 
```
----line 1 of _none_ col 1
File "_none_", line 1:
Error: Generated bytecode library "graph.cma" cannot be used on a 32-bit platform
```
By using 32-bit integer literals[1], we avoid the issue by eschewing platform-native integers.

[1] https://v2.ocaml.org/api/Int32.html
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant