[m-rev.] for review: fix an inaccurate error message

Zoltan Somogyi zoltan.somogyi at runbox.com
Sun Mar 30 15:40:00 AEDT 2025



On Sun, 30 Mar 2025 15:14:44 +1100, Julien Fischer <jfischer at opturion.com> wrote:
> I have attached a test case for this bug.  I have not included it in
> the diff because
> I cannot make it work with any of the various invalid test directories we have.
> (Rewriting it to use separate submodules has similar problems.) Suggestions
> on where the test case should live would be appreciated.

The diff itself is fine. I don't think it even needs a test case.

If you do want to add one anyway, I would fix the issues reported by mmc
first:

undef_in_ancestor.m:009: Warning: the interface of module `undef_in_ancestor'
undef_in_ancestor.m:009:   does not export anything.
mercury_compile: cannot find `undef_in_ancestor.int0' in directories `.',
  `/home/public/mercury-install-2025-03-26/lib/mercury/ints'
undef_in_ancestor.m:012: In module `undef_in_ancestor':
undef_in_ancestor.m:012:   warning: module `list' is imported in the interface,
undef_in_ancestor.m:012:   but it is not used in the interface.
undef_in_ancestor.m:013: In module `undef_in_ancestor':
undef_in_ancestor.m:013:   warning: module `io' is imported in the interface,
undef_in_ancestor.m:013:   but it is not used in the interface.
For more information, recompile with `-E'.

Doing "mmc --make-private-interface" first would of course fix "cannot find .int0"
and get the diagnostic tweaked by the diff. You are right that no test directory
has a test procedure that includes making .int0 files first. I don't think this issue
is sufficient motivation for adding one.

I would add the test case to invalid_submodules, after (a) fixing the warnings above,
and (b) adding comments specifying the exact steps to reproduce the diagnostic.
I would then add a comment to the Mmakefile saying that this test case is not enabled
due the lack of a home for the test setup compatible with those steps.

Zoltan.


More information about the reviews mailing list