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

Zoltan Somogyi zoltan.somogyi at runbox.com
Tue Nov 22 11:09:41 AEDT 2022


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.

> 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.

> I never liked the asterisks either but I understand it's mimicking
> GNU make (for whatever reason).

I feel the same way.

Zoltan,


More information about the reviews mailing list