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

Compiler behaviour on -o foo and no input files #12497

Closed
shindere opened this issue Aug 24, 2023 · 1 comment · Fixed by #12613
Closed

Compiler behaviour on -o foo and no input files #12497

shindere opened this issue Aug 24, 2023 · 1 comment · Fixed by #12613

Comments

@shindere
Copy link
Contributor

gcc -o foo says gcc: fatal error: no input files and fails (exit code 1).

When given -o foo as arguemnts, both ocamlc and ocamlopt will succeed
(exit with 0), emit no error message but not write an executable file either.

Am I correct that this is a bug rather than a feature?

Would be happy to provide a fix because, while working on the compiler's
build system, I'm regularly bitten by this when, for some reason,
the GNU make variable that is supposed to contain the list of input
files turns out to be empty.

@gasche
Copy link
Member

gasche commented Aug 24, 2023

There would be one sensible behavior for ocamlc -o foo, which is to emit a program that does nothing. We are doing something else, so the current behavior is buggy, and I believe it is okay to change it to something else. So yes, from a distance I think that emitting an error in this case would be a reasonable change.

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

Successfully merging a pull request may close this issue.

2 participants