Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
-output-obj leaves a C file in case of Reference to undefined global #5593
Original bug ID: 5593
Consider a file a.ml with a reference to Unix.
The following command line fails as expected:
$ ocamlc -output-obj -o a.c a.cmo
But it leaves an incomplete file a.c. This is annoying because if one then fixes the command-line, the compiler refuses to overwrite this file:
$ ocamlc -output-obj -o a.c unix.cma a.cmo
I suggest to have "ocamlc -output-obj" removes its output in case of a linking error.