When trying to use optint with wasm_of_ocaml I got lots of warnings:
$ cat > t.ml <<'EOF'
let () = print_string (Optint.to_string (Optint.of_int 42))
EOF
$ ocamlfind ocamlc -package optint -linkpkg t.ml -o t.byte
$ js_of_ocaml t.byte -o t.js # silent
$ wasm_of_ocaml t.byte -o t.wasm.js
Warning [integer-overflow]: integer 0x7fffffff (2147483647) truncated to 0xffffffff (-1); the generated code might be incorrect.
Warning [integer-overflow]: integer 0x40000000 (1073741824) truncated to 0xc0000000 (-1073741824); the generated code might be incorrect.
Warning [integer-overflow]: integer 0x40000000 (1073741824) truncated to 0xc0000000 (-1073741824); the generated code might be incorrect.
I think this is warning for dead-code as Immediate64.repr dispatches on Sys.word_size = 64, so a 31-bit runtime only executes optint_emul. So this isn't a big deal but "generated code might be incorrect" spam in my build logs is a bit annoying.
I can try to make a PR to create those constant by converting from an int64 if you are interested.
When trying to use optint with wasm_of_ocaml I got lots of warnings:
I think this is warning for dead-code as
Immediate64.reprdispatches onSys.word_size = 64, so a 31-bit runtime only executesoptint_emul. So this isn't a big deal but "generated code might be incorrect" spam in my build logs is a bit annoying.I can try to make a PR to create those constant by converting from an
int64if you are interested.