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

Empty executable #3364

Closed
vicuna opened this issue May 29, 2002 · 4 comments
Closed

Empty executable #3364

vicuna opened this issue May 29, 2002 · 4 comments
Labels

Comments

@vicuna
Copy link

vicuna commented May 29, 2002

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

Bug description

Full_Name: Benjamin Pierce
Version: 3.04
OS: linux
Submission from: adsl-216-158-26-151.cust.oldcity.dca.net (216.158.26.151)

I just discovered (by means of a makefile bug) that if ocamlc is presented with
an empty list of object files, like

ocamlc -o junk

it will happily create an executable file junk that, when run, does nothing.

I guess this is not precisely a bug, but it did cost me some time and the
present
behavior does not seem very useful. How about disallowing empty lists of object
files?

Thanks,

 B
@vicuna
Copy link
Author

vicuna commented Jun 3, 2002

Comment author: administrator

I'm surprised, because this (highly logical :-) behavior was removed
in March 2000, at the time of OCaml 3.00. I can't reproduce it with
the current development version: ocamlc -o junk will do nothing.

You're right: 'ocamlc -o junk' seems to do nothing for me also. I guess
it's possible that I was fooled before (e.g., there was already an
executable named junk). I'll let you know if I get any new data.

I'd still argue, though, that giving a warning message would be much
better than doing nothing.

 B

@vicuna
Copy link
Author

vicuna commented Jun 3, 2002

Comment author: administrator

Hi Benli,

I just discovered (by means of a makefile bug) that if ocamlc is
presented with an empty list of object files, like

ocamlc -o junk

it will happily create an executable file junk that, when run, does nothing.

I'm surprised, because this (highly logical :-) behavior was removed
in March 2000, at the time of OCaml 3.00. I can't reproduce it with
the current development version: ocamlc -o junk will do nothing.

ocamlc -a -o junk.cma still generates an empty junk.cma library, but
it could be argued that empty libraries can be useful in weird
circumstances...

Cheers,

  • Xavier

@vicuna
Copy link
Author

vicuna commented Jun 3, 2002

Comment author: administrator

Can't reproduce in 3.04+

@vicuna vicuna closed this as completed Jun 3, 2002
@vicuna
Copy link
Author

vicuna commented Jun 4, 2002

Comment author: administrator

From: bcpierce@cis.upenn.edu

You're right: 'ocamlc -o junk' seems to do nothing for me also. I guess
it's possible that I was fooled before (e.g., there was already an
executable named junk). I'll let you know if I get any new data.

I'd still argue, though, that giving a warning message would be much
better than doing nothing.

I particularly like gtar's message in such case:

$ gtar cvf test.tar
gtar: Cowardly refusing to create an empty archive

Jacques

@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