Subject: bin/4376: there are a few year 2000 problems in the roff macros
To: None <email@example.com>
From: None <cgd@NetBSD.ORG>
Date: 10/29/1997 00:45:35
>Synopsis: there are a few year 2000 problems in the roff macros
>Responsible: bin-bug-people (Utility Bug People)
>Arrival-Date: Tue Oct 28 16:50:19 1997
>Originator: Chris G. Demetriou
Kernel Hackers 'r' Us
>Release: NetBSD-current (1.3_ALPHA) as of October 27, 1997
System: NetBSD brick.demetriou.com 1.3_ALPHA NetBSD 1.3_ALPHA (BRICK) #8: Mon Oct 27 22:40:17 PST 1997 firstname.lastname@example.org:/usr/src/sys/arch/i386/compile/BRICK i386
There are a few year 2000 problems in the roff macros.
A quick grep of /usr/share/tmac for uses of the 'yr' register yields:
tmac/tmac.doc-common:. as dD \&\ \\n(dy, 19\\n(yr
tmac/tmac.e:.ds td \*(mo \n(dy, 19\n(yr
tmac/tmac.m:.ie \\n[yr]<50 .ds cov*new-date \\*[MO\\n[mo]] \\n[dy], 20\\n[yr]
tmac/tmac.m:.el .ds cov*new-date \\*[MO\\n[mo]] \\n[dy], 19\\n[yr]
tmac/tmac.mse:.ie \\n[yr]<50 .ds cov*new-date \\*[MO\\n[mo]] \\n[dy], 20\\n[yr]
tmac/tmac.mse:.el .ds cov*new-date \\*[MO\\n[mo]] \\n[dy], 19\\n[yr]
tmac/tmac.s:.nr *year \n[yr]+1900
Looking at the groff sources, it appears that it puts
a struct tm's tm_year into the 'yr' register directly (wihtout
modification), meaning that it's the year - 1900. I don't know
if that's the 'canonical' definition of the yr register, or
if the 'yr' register is defined such that it must be two digits
only, but any way you look at it _some_ of the macros are wrong.
the doc and e macros will obviously break (regardless of
yr's representation) as of the year 2000.
the m and mse macros seem to be coded such that they'll work
if the representation of 'yr' is "year % 100", but only until
2050 (by which time, hopefully all forms of roff will be dead
and buried). They won't work if yr really is printed as
the year - 1900 as would seem to happen.
the s macros appear to work if the yr register is supposed to
contain the year - 1900 (which is the case with our version
of groff, as far as I can tell), but won't work if it's
year % 100.
(Note that this was filed as bin/sw-bug, since the macros
themselves are not documentation, but rather are the 'software'
that is used to build the documentation.)
Read the roff code.
I don't know, and I don't care to learn roff well enough to
Just over 26 months before this becomes a real problem. 8-)