Subject: bin/4376: there are a few year 2000 problems in the roff macros
To: None <gnats-bugs@gnats.netbsd.org>
From: None <cgd@NetBSD.ORG>
List: netbsd-bugs
Date: 10/29/1997 00:45:35
>Number:         4376
>Category:       bin
>Synopsis:       there are a few year 2000 problems in the roff macros
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people (Utility Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Oct 28 16:50:19 1997
>Last-Modified:
>Originator:     Chris G. Demetriou
>Organization:
Kernel Hackers 'r' Us
>Release:        NetBSD-current (1.3_ALPHA) as of October 27, 1997
>Environment:
System: NetBSD brick.demetriou.com 1.3_ALPHA NetBSD 1.3_ALPHA (BRICK) #8: Mon Oct 27 22:40:17 PST 1997 cgd@brick.demetriou.com:/usr/src/sys/arch/i386/compile/BRICK i386


>Description:
	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.)

>How-To-Repeat:
	Read the roff code.

>Fix:
	I don't know, and I don't care to learn roff well enough to
	even try.

	Just over 26 months before this becomes a real problem.  8-)
>Audit-Trail:
>Unformatted: