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

                 Summary: [troff] should warn when GNU extension scaling units
used in compatibility mode
                   Group: GNU roff
               Submitter: gbranden
               Submitted: Mon 13 Apr 2026 06:28:57 PM UTC
                Category: Core
                Severity: 3 - Normal
              Item Group: Warning/Suspicious behaviour
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Unlocked
         Planned Release: None


    _______________________________________________________

Follow-up Comments:


-------------------------------------------------------
Date: Mon 13 Apr 2026 06:28:57 PM UTC By: G. Branden Robinson <gbranden>
A numeric expression ends as soon as a character that is invalid in it is
encountered.

When a numeric expression is the predicate being tested in a control structure
like `if` or `ie`, the existence of GNU _troff_'s additional scaling units
means that control flow is not consistent between AT&T and GNU _troff_s, even
when the latter is in compatibility mode.

Observe:


$ echo '.if 0f=0f .tm true' | troff
true
$ echo '.if 0f=0f .tm true' | heirloom troff >/dev/null 2>&1 | grep . || echo
NO OUTPUT
NO OUTPUT
$ echo '.if 0f=0f .tm true' | 9 troff >/dev/null 2>&1 | grep . || echo NO
OUTPUT
NO OUTPUT
$ echo '.if 0f=0f .tm true' | dwb troff >/dev/null 2>&1 | grep . || echo NO
OUTPUT
NO OUTPUT


We should warn about this.  I have no intention to change GNU _troff_'s
**behavior** here, just to caution the user that their use of compatibility
mode does not create an AT&T _troff_ simulator.  We attempt to be frank with
the user about its limited purpose.

_groff_diff_(7):

Compatibility mode
     GNU troff’s features sometimes cause incompatibilities with
     documents written assuming old implementations of troff.  Some
     syntactical and behavioral differences between them are thought too
     important to neglect; GNU troff therefore makes available a
     compatibility mode in an effort to keep documents prepared for AT&T
     troff rendering well.


No document "prepared for AT&T _troff_ rendering" is going to use GNU
_troff_'s extensions.









    _______________________________________________________

Reply to this item at:

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

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

Attachment: signature.asc
Description: PGP signature

Reply via email to