groff
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Prefix for warnings (was: device-dependent warnings)


From: Ingo Schwarze
Subject: Re: Prefix for warnings (was: device-dependent warnings)
Date: Wed, 3 May 2023 02:42:56 +0200

Hi Alejandro,

Alejandro Colomar wrote on Wed, May 03, 2023 at 01:26:55AM +0200:

> I find it more readable when there's one space between the program
> that generates the warning and the file.  That's what mandoc(1) does,
> and in general, what any program that relies on perror(3) does (I'm
> assuming mandoc(1) probably calls perror(3) or similar).

Mandoc does not use perror(3); the code in question is in the
function mandoc_msg(3) in this file:

  https://cvsweb.openbsd.org/src/usr.bin/mandoc/mandoc_msg.c?rev=HEAD

That is, the message output function has been polished to be as
simple and straightforward as possible, but without hardcoding
stderr.  In -T lint mode, the messages go to stdout instead of
stderr because in that mode, the messages are considered to be
the desired output of the program and not error messages.

> mandoc: man8/unitd.8:6:2: WARNING: first section is not "NAME": Sh Name
> troff:man3/unlocked_stdio.3:123: warning [p 2, 1.8i, div '3tbd1,0',
>         0.3i]: cannot break line

And:

   $ cat oops.txt                                  
 cat: oops.txt: No such file or directory

So i certainly agree that the space character makes the message
slightly easier to read and makes it look slightly more familiar.

Then again, happy bikeshedding!
  Ingo



reply via email to

[Prev in Thread] Current Thread [Next in Thread]