[m-rev.] changed "no targets specified" message

Peter Wang novalazy at gmail.com
Tue Nov 22 17:15:22 AEDT 2022


On Tue, 22 Nov 2022 11:09:41 +1100 "Zoltan Somogyi" <zoltan.somogyi at runbox.com> wrote:
> 
> 2022-11-22 10:50 GMT+11:00 "Peter Wang" <novalazy at gmail.com>:
> > Hi,
> > 
> > Since commit c2be36780, the compiler prints this error message when
> > mmc --make is called without a target:
> > 
> > `mercury_compile': *** Error: no targets specified and `MAIN_TARGET' not
> >   defined.
> > 
> > I prefer how it used to look:
> > 
> > ** Error: no targets specified and `MAIN_TARGET' not defined.
> > 
> > 
> > Can we change it back? Or remove the `quotes' around mercury_compile,
> 
> I use mmc --make very rarely, so I can live with whatever people who
> do use it prefer. However, I do think it is a good idea for error messages
> to say what program generated them, if this is not obvious from the
> message itself. In this case, I think "no targets specified and `MAIN_TARGET' not defined"
> does not make it obvious: it could be from mmc, or from make.
> I think we should either keep the "mercury_compile:" part, or
> change the wording that follows it, maybe to "no targets given to mmc",
> to provide this info. I do agree that the quotes should go.
> 

How about one of:

mercury_compile: *** Error: no target specified.
mercury_compile: *** Error: no target or `MAIN_TARGET' specified.
mercury_compile: *** Error: no target specified and `MAIN_TARGET' not defined.

> > and fit the whole message on a single line instead of wrapping and
> > indenting the last word. (At first I thought something had gone wrong
> > with my terminal emulator.)
> 
> A single line longer than the window width would be wrapped in any case.
> When using error_specs, the line will be broken at a word boundary, which
> I think is preferable to having it happen in the middle of a word. But I agree,
> a short message that fits on one line is even better.

That's fine for the long messages we generate for program errors.

For other errors, I'd prefer each error message to appear on a single
line, even if it might exceed what the compiler *thinks* the window
width is. If they happen to be formatted with error_specs then I think
they should behave as though --no-max-error-line-width was passed.

Peter


More information about the reviews mailing list