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

[BUG] Checking for constant overflow only work in whole program compilation #1051

Closed
hhugo opened this issue Aug 14, 2020 · 2 comments
Closed
Labels

Comments

@hhugo
Copy link
Member

hhugo commented Aug 14, 2020

let () = Printf.printf "%nx" 0xffffffffn;;

generate the following warning in whole program compilation

Warning: integer overflow: integer 0xffffffff (4294967295) truncated to 0xffffffff (-1); the generated code might be incorrect.

The same warning should trigger with separate compilation.

As an extension, we could imagine only warning if the problematic constant ends up being used in the generate javascript and give a chance to the deadcode elimination to do its job

@hhugo hhugo added the bug label Aug 14, 2020
@hhugo
Copy link
Member Author

hhugo commented Aug 14, 2020

cc @xclerc

@xclerc
Copy link
Collaborator

xclerc commented Aug 19, 2020

Tentative fix in #1052.

hhugo pushed a commit that referenced this issue Sep 9, 2020
* Reproduction case.

* Ensure the overflow warning is always displayed.

* Synchronize "tools/travis.sh" with ".ocamlformat".

* Dot no use the `Int` module, for the sake of backward compatibility.

* Apply ocamlformat.

* `Nativeint.equal` was not defined in OCaml 4.02.

* Typo.
@hhugo hhugo closed this as completed Sep 9, 2020
hhugo added a commit to hhugo/opam-repository that referenced this issue Sep 29, 2020
…ml-ppx, js_of_ocaml-lwt, js_of_ocaml-toplevel, js_of_ocaml-tyxml, js_of_ocaml and js_of_ocaml-ppx_deriving_json (3.7.1)

CHANGES:

## Features/Changes
* lib: Add Navigator.{vendor,maxTouchPoints} (ocsigen/js_of_ocaml#1062)
* lib: adds the intersection observer API (ocsigen/js_of_ocaml#1063)

## Bug fixes
* compiler: revert of "Eliminate allocation of dummy function ocsigen/js_of_ocaml#1013"
* compiler: fix for ocsigen/js_of_ocaml#1051 (ocsigen/js_of_ocaml#1052), Ensure the overflow warning is always displayed
* runtime: add missing primitives for 4.11
* lib: Fix resize-observer (ocsigen/js_of_ocaml#1058)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants