Bug#847972: man: Eliminate warnings from '*roff' about the undefined register 'F'

Bjarni Ingi Gislason bjarniig at rhi.hi.is
Thu Jan 5 18:41:03 UTC 2017


On Sat, Dec 17, 2016 at 11:24:57AM -0800, Russ Allbery wrote:
> Colin Watson <cjwatson at debian.org> writes:
> 
> > I can see that that is attempting to avoid a warning.  However, it is
> > not quite correct.  It should probably be something like this instead:
> 
> >   .if !r F .nr F 0
> 
> > I think ".if !\nF .nr F 0" is basically a no-op, even when warnings are
> > taken into account.  It does arrange that if F was previously
> > initialised to a negative number then it will be set to 0 instead (since
> > negative numbers are falsy in groff), but I don't think that matters
> > much since the subsequent test is "\nF>0" anyway.
> 
> I've reverted this code to the earlier version of:
> 
  This is the wrong thing to do.  Remove my patch.  It only eliminates a
symptom, not the cause of it.  The real one is to add "-rF0" to the
definition of "troff" and "nroff" (see "/etc/manpath.config" or
"/etc/man_db.conf") in "man-db".  Any user can add this to its personal
configuration file, until this bug in "man-db" is fixed.

> .de IX
> ..
> .nr rF 0
> .if \n(.g .if rF .nr rF 1
> .if (\n(rF:(\n(.g==0)) \{\
> .    if \nF \{\
> .        de IX
> .        tm Index:\\$1\t\\n%\t"\\$2"
> ..
> .        if !\nF==2 \{\
> .            nr % 0
> .            nr F 2
> .    \}
> .\}
> .rr rF
> 
> which does seem to work, and suppresses the warning.  This was changed
> because of blank leading pages on HP-UX, but that was later tracked down
> to the missing \ at the end of \{ lines, so I can just fix that directly
> and keep the more complex code.  Assuming I understand this correctly,
> this uses the r test on groff where it's supported, and just
> unconditionally tests \nF elsewhere where the warnings are just the price
> we pay.
> 
> This will be in the next podlators release (no schedule yet for that,
> since I don't think this is too serious of an issue).
> 
> -- 
> Russ Allbery (rra at debian.org)               <http://www.eyrie.org/~eagle/>

  The default action of "man-db" is to remove ALL warnings from "groff",
even when the option "--warnings=..." is used (including the default "mac",
if the "..." is an empty string).

-- 
Bjarni I. Gislason




More information about the Perl-maintainers mailing list