Follow-up Comment #1, bug #67935 (group groff):

Hey, all of a sudden the "Reply-To" headers of new Savannah tickets no longer
contain the address for the robot that appends comments to tickets!  No fair!

Anyway.

[comment #0 original submission:]
> tmac/an.tmac, tmac/doc.tmac, and contrib/mom/om.tmac contain this test:
> 
> .if (\n[.x]\n[.y] < 118)
> 
> While the integer concatenation, which most languages would disallow, is
> clever, this test will begin returning incorrect results upon release of
> groff 2.0.
> 
> At the risk of exhibiting the same lack of foresight that birthed the Y2K
> bug, if we assume that no element of a groff version number will ever exceed
> three digits, a safe replacement for this test would be:
> 
> .if ((\n[.x]*1000)+\n[.y] < 1018)
> 
> The inner set of parentheses is unnecessary, but the roff family's quirky
> arithmetic precedence rules tend to make me overparenthesize all arithmetic
> expressions for clarity.
> 
> (This came to my attention when the offending lines of an.tmac and doc.tmac
> were mentioned in http://lists.gnu.org/r/groff/2026-01/msg00073.html)

Fair point.

However, one could avoid the use of non-PEMDAS *roff arithmetic altogether by
writing multiple conditional tests.

On the other hand, _groff_ 1.18 is now 24 years old.

Even the last GPLv2-licensed version of _groff_, which people in some quarters
kept around so they could virtuously trash the FSF to each other while lifting
at the company gym, is over 20 years old.

Maybe we should just take these guards out.

If anything/anyone screams, we could restore not the version test you observe,
but (a) feature test(s), as Ingo stridently advises, and as we already do in
_groff_'s own man pages.


$ sed -n '35,48p' src/utils/addftinfo/addftinfo.1.man 
.\" Define fallback for groff 1.23's MR macro if the system lacks it.
.nr do-fallback 0
.if !\n(.f           .nr do-fallback 1 \" mandoc
.if  \n(.g .if !d MR .nr do-fallback 1 \" older groff
.if !\n(.g           .nr do-fallback 1 \" non-groff *roff
.if \n[do-fallback]  \{\
.  de MR
.    ie \\n(.$=1 \
.      I \%\\$1
.    el \
.      IR \%\\$1 (\\$2)\\$3
.  .
.\}
.rr do-fallback




    _______________________________________________________

Reply to this item at:

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

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

Attachment: signature.asc
Description: PGP signature

Reply via email to