Computer bugs in the year 2000 (do-it-yourself)
Alexis Dimitriadis
alexis at reed.UUCP
Wed Jan 30 13:25:59 AEST 1985
>
> If you are really worried about timewrap breaking programs in subtle ways,
> then set your clock ahead now, and find the bugs. That will give you several
> years to fix them. If you are binary only, you might NEED several years
> to get you vendor to fix them! :-)
> --
> Duty Now for the Future
> Tim Smith
> ihnp4!wlbr!callan!tim or ihnp4!cithep!tim
With most library functions, you do not need to reset the machine clock--
just call them with the right number of seconds, and see what they do.
(You might even catch some of the overflow problems that have been discussed
here).
I attached a simple program that does that, just run it and give it
the number of years you want to go forward (or backward, if < 0),
or can substitute your pet functions for time() and ctime().
E.g., I found that we DO have the bug in ctime that prints every year
after 2000 as year 2. (and without a trailing newline...)
alexis @ reed
---------------------------
#include <stdio.h>
#include <sys/time.h>
#define YEAR 31536000 /* only roughly, but who cares */
main()
{
long time(), clock;
float increment;
char * ctime();
time(&clock);
fputs(ctime(&clock), stdout);
while (scanf("%f", &increment) > 0) {
clock += (long) (increment * YEAR);
fputs(ctime(&clock), stdout);
}
}
More information about the Net.bugs
mailing list