URL:
  <https://savannah.gnu.org/bugs/?68284>

                 Summary: [troff] `pnr` request suggests that read-only `.O`
register is mutable
                   Group: GNU roff
               Submitter: gbranden
               Submitted: Mon 27 Apr 2026 05:06:54 AM UTC
                Category: Core
                Severity: 2 - Minor
              Item Group: Incorrect behaviour
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Unlocked
         Planned Release: None


    _______________________________________________________

Follow-up Comments:


-------------------------------------------------------
Date: Mon 27 Apr 2026 05:06:54 AM UTC By: G. Branden Robinson <gbranden>
A read-only register cannot have an auto-incrementation value.  Such would be
meaningless, since its value can only be updated via internal logic.

Yet the `.O` read-only register reports an auto-incrementation value (of zero,
of course) via the `pnr` request.

This probably means that it's incorrectly situated in the `reg` class
hierarchy.  Relocate it.

First, here's a dump of the numeric read-only registers; all report a name,
value, and number format (always Arabic).


$ echo '.pnr' | groff 2>&1 | sort | grep '^\..*       .*      '
.L      1       0
.O      0       +0      0
.b      0       0
.cdp    0       0
.ce     0       0
.cht    0       0
.csk    0       0
.f      1       0
.height 0       0
.hlc    0       0
.hlm    -1      0
.hym    0       0
.hys    0       0
.i      0       0
.in     0       0
.int    0       0
.it     -1      0
.itc    0       0
.k      0       0
.l      468000  0
.linetabs       0       0
.ll     468000  0
.lt     468000  0
.n      0       0
.nm     0       0
.nn     0       0
.ps     10000   0
.psr    10000   0
.pvs    0       0
.rj     0       0
.slant  0       0
.ss     12      0
.sss    12      0
.u      1       0
.ul     0       0
.v      12000   0
.w      0       0
.zoom   0       0


(Note 1: Those are literal tabs, not spaces, in my _grep_(1) regex.  I don't
know of a portable printable way to specify byte values in a POSIX BRE or
ERE.)

(Note 2: The foregoing omits Boolean-valued registers, because they don't have
a number format.  This doesn't fuss me because such values are seldom useful
in any contexts besides debugging and testing in conditional expressions,
where non-Arabic formats don't work anyway.)

Now let's grep for _three_ tabs.


$ echo '.pnr' | groff 2>&1 | sort | grep '^\..*       .*      .*      '
.O      0       +0      0


See if that guy needs some rogering.









    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?68284>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/

Attachment: signature.asc
Description: PGP signature

Reply via email to