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

Division_by_zero [div by 0 vs -unsafe] #3989

Closed
vicuna opened this issue Mar 17, 2006 · 2 comments
Closed

Division_by_zero [div by 0 vs -unsafe] #3989

vicuna opened this issue Mar 17, 2006 · 2 comments
Assignees
Labels

Comments

@vicuna
Copy link

vicuna commented Mar 17, 2006

Original bug ID: 3989
Reporter: Christophe
Assigned to: @xavierleroy
Status: closed (set by @xavierleroy on 2006-06-13T09:05:07Z)
Resolution: fixed
Priority: normal
Severity: minor
Version: 3.09.1
Category: ~DO NOT USE (was: OCaml general)

Bug description

exception Division_by_zero is not raised with ocamlopt -unsafe.
It is correctly raised with ocamlc -unsafe dans ocamlopt.

I don't known if it is a bug or an undocumented feature, but if it is a feature, it must be explicit in the documentation (in ocamlopt section, and perhaps in Pervasives !) !!!
It breaks any function that try to catch such exception....

Additional information

% cat toto.ml
let _ = Printf.printf "%i\n%!" (1/0)
% ocamlc -unsafe toto.ml -o toto
% ./toto
Fatal error: exception Division_by_zero
% ocamlopt.opt toto.ml -o toto
% ./toto
Fatal error: exception Division_by_zero
% ocamlopt -unsafe toto.ml -o toto
% ./toto
0

@vicuna
Copy link
Author

vicuna commented Mar 22, 2006

Comment author: @xavierleroy

Must document that -unsafe turns off the check for zero divisor.

@vicuna
Copy link
Author

vicuna commented Jun 13, 2006

Comment author: @xavierleroy

Documented this behavior in "Native-code compilation" chapter.

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