You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Original bug ID: 5611 Reporter:@zoggy Assigned to: meyer Status: closed (set by @xavierleroy on 2015-12-11T18:08:06Z) Resolution: fixed Priority: normal Severity: minor Version: 4.00.0+dev Target version: 4.01.0+dev Fixed in version: 4.01.0+dev Category: ~DO NOT USE (was: OCaml general)
Bug description
Giving a .cmo file to -o option of ocamlc without -c ends with a fatal error.
Steps to reproduce
ocamlc -v
The OCaml compiler, version 4.00.0+dev17_2012-05-02
Standard library directory: /opt/ocaml-4/lib/ocaml
cat > t.ml
let x = 1;;
ocamlc -o t.cmo t.ml
Fatal error: exception End_of_file
But the following works:
ocamlc -c -o t.cmo t.ml
ocamlc -o t.x t.ml
The text was updated successfully, but these errors were encountered:
My guess: when you say "ocamlc -o t.cmo t.ml", the compiler first compiles t.ml to t.cmo, then tries to link the t.cmo object file to produce an executable named t.cmo. At some point, it opens t.cmo for writing (thus erasing it), then tries to copy data from t.cmo to t.cmo, which fails.
I think we need a better error message. In the meantime, the workaround is obvious: don't do that.
Also, I have no idea how it could work in 3.12.1...
Original bug ID: 5611
Reporter: @zoggy
Assigned to: meyer
Status: closed (set by @xavierleroy on 2015-12-11T18:08:06Z)
Resolution: fixed
Priority: normal
Severity: minor
Version: 4.00.0+dev
Target version: 4.01.0+dev
Fixed in version: 4.01.0+dev
Category: ~DO NOT USE (was: OCaml general)
Bug description
Giving a .cmo file to -o option of ocamlc without -c ends with a fatal error.
Steps to reproduce
ocamlc -v
The OCaml compiler, version 4.00.0+dev17_2012-05-02
Standard library directory: /opt/ocaml-4/lib/ocaml
cat > t.ml
let x = 1;;
ocamlc -o t.cmo t.ml
Fatal error: exception End_of_file
But the following works:
ocamlc -c -o t.cmo t.ml
ocamlc -o t.x t.ml
The text was updated successfully, but these errors were encountered: