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

Russ Allbery rra at debian.org
Sat Dec 17 19:24:57 UTC 2016


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:

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




More information about the Perl-maintainers mailing list