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

Using "unused values" warnings also for vlaues at the top-level of a module/compilation unit #4033

Closed
vicuna opened this issue May 28, 2006 · 1 comment

Comments

@vicuna
Copy link

vicuna commented May 28, 2006

Original bug ID: 4033
Reporter: oliver
Assigned to: @alainfrisch
Status: closed (set by @alainfrisch on 2011-12-21T16:23:47Z)
Resolution: duplicate
Priority: normal
Severity: feature
Category: ~DO NOT USE (was: OCaml general)
Duplicate of: #5438
Related to: #4076

Bug description

Nice would be to enhance the following warnings:

 Y/y enable/disable suspicious unused variables
 Z/z enable/disable all other unused variables

so that they also can be used for values that are not
inside any function, but are on the "top-level" of a module/compilation unit.

It's clear that an unconstrained structure (no signature used
by the programmer, so that the default signature is used and
makes all things accessible from the outside) of a compilation
unit or module should not create a warning on internally unused
values (because they might be used from the outside).

But when a signature is used by the programmer to narrow the signature
of a module from the default-sig to a customized sig, then all values
that are not visable from the outside (not part of the signature)
nor used inside the module (not used inside) might be unused ("dead code")
in general and in the future.

And IMHO, throwing out dead code is always a good idea.

Wouldn't the option "-w W"/"-w w" be a candidate here?

@vicuna
Copy link
Author

vicuna commented Aug 29, 2006

Comment author: @damiendoligez

unlikely to be implemented anytime soon

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

2 participants