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

camlp4, assertion and -noassert #8058

Closed
vicuna opened this issue Mar 12, 2003 · 2 comments
Closed

camlp4, assertion and -noassert #8058

vicuna opened this issue Mar 12, 2003 · 2 comments
Labels

Comments

@vicuna
Copy link

vicuna commented Mar 12, 2003

Original bug ID: 1588
Reporter: administrator
Status: closed
Resolution: fixed
Priority: normal
Severity: minor
Category: ~DO NOT USE (was: OCaml general)

Bug description

Full_Name: Julien Signoles
Version: 3.06
OS: Linux
Submission from: newwww.lri.fr (129.175.15.10)

$ cat foo.ml
let _ = if print_endline "a"; 0 = 1 then () else assert false
$ camlp4o pr_o.cmo foo.ml > foo_p4.ml
$ cat foo_p4.ml
let _ = assert begin print_endline "a"; 0 = 1 end
$ ocamlc -noassert -o foo foo.ml
$ ./foo
a
Fatal error: exception Assert_failure("assert.ml", 30, 42)
$ ocamlc -noassert -o foo_p4 foo_p4.ml
$ ./foo_p4
$

As camlp4 automatically changes "if cond then () else assert false" by "assert
(cond)", there is no more assert failure if you use -noassert (except when cond
= false (syntactically)).
Morever, side effects semantic is modified.

--
Julien Signoles.

@vicuna
Copy link
Author

vicuna commented Mar 13, 2003

Comment author: administrator

$ cat foo.ml
let _ = if print_endline "a"; 0 = 1 then () else assert false
$ camlp4o pr_o.cmo foo.ml > foo_p4.ml
$ cat foo_p4.ml
let _ = assert begin print_endline "a"; 0 = 1 end

Thanks for your bug report. This is fixed in the working sources.

-- Damien

@vicuna
Copy link
Author

vicuna commented Mar 13, 2003

Comment author: administrator

Fixed by DD 2003-03-13

@vicuna vicuna closed this as completed Mar 13, 2003
@vicuna vicuna added the bug label Mar 19, 2019
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

1 participant