[m-rev.] for review: make --warn-unused-imports more effective
Zoltan Somogyi
zoltan.somogyi at runbox.com
Sat Nov 29 02:23:01 AEDT 2025
On Sat, 29 Nov 2025 01:24:30 +1100, Julien Fischer <jfischer at opturion.com> wrote:
> > -% is unused *anywhere* in the module. However, even if
> --warn-unused-imports
> > -% *is* set, the code in unused_imports.m won't be invoked if we stop
> > -% compilation before its normal invocation time, due to e.g. type or more
> > -% errors. What we should do is generate warnings here; print them if we
> > -% stop before the unused_imports pass; throw them away if we *do* get to
> > -% that pass. We don't (yet) do this.
> > +% can generate all the warnings we would, but it can generate *more*
> messages,
> > +% since unlike the code here, it can report that an imported module is
> unused
> > +% *anywhere* in the module. However, even if --warn-unused-imports *is*
> set,
> > +% the code in unused_imports.m won't be invoked if we stop compilation
> > +% before its normal invocation time, due to e.g. type or more
>
> Did you mean mode errors there?
The original text meant that, but that was an incomplete change. After all,
the values of options don't influence whether the code has type or mode errors.
That text now reads:
% ... However, even if --warn-unused-imports *is* set,
% the code in unused_imports.m won't be invoked if we stop compilation
% before its normal invocation time, due to e.g. the op_mode being
% the creation of an interface file. We therefore print warnings about
% unneeded imports in the interface section only if the option controlling
% its operation dictates that the code in unused_imports.m won't be invoked.
Thanks for the catch, and for the review. I followed your other suggestion as well.
Zoltan.
More information about the reviews
mailing list