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

avoid overwriting files when mistakenly setting -o to a source or intermediate filename #6218

Closed
vicuna opened this issue Nov 2, 2013 · 3 comments

Comments

@vicuna
Copy link

vicuna commented Nov 2, 2013

Original bug ID: 6218
Reporter: goswin
Status: confirmed (set by @mshinwell on 2014-05-30T13:19:38Z)
Resolution: open
Priority: normal
Severity: tweak
Version: 4.00.1
Category: compiler driver
Tags: junior_job
Related to: #6475
Monitored by: @gasche

Bug description

When using the name of an intermediate file as output name the compiler truncates it own files and fails:

% ocamlopt -output-obj -o foo.o foo.ml
foo.o: file not recognized: File truncated
File "caml_startup", line 1:
Error: Error during linking

It would be easier to understand the problem if ocamlopt would catch the name collision.

Steps to reproduce

echo "let () = ()" >foo.ml
ocamlopt -output-obj -o foo.o foo.ml

@vicuna
Copy link
Author

vicuna commented Mar 1, 2017

Comment author: @damiendoligez

See also:
#6475
#464 ( #464 )
#758 ( #758 )

@vicuna
Copy link
Author

vicuna commented Mar 1, 2017

Comment author: @damiendoligez

Not sure if this is fixed. I tried the command on MacOSX and it didn't raise any error but the ld invocation looks suspect.

@github-actions
Copy link

This issue has been open one year with no activity. Consequently, it is being marked with the "stale" label. What this means is that the issue will be automatically closed in 30 days unless more comments are added or the "stale" label is removed. Comments that provide new information on the issue are especially welcome: is it still reproducible? did it appear in other contexts? how critical is it? etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant