C (158/207)

From:Olaf Barthel
Date:23 Dec 99 at 15:36:30
Subject:Re: Version String, CPU detection

On Dec 22 Fritsch (Fritsch Alexander) wrote:

> From: Fritsch Alexander <Alexander.Fritsch@icn.siemens.de>
>
> Hello,
> could someone tell me how the format of a version string has to be?
> I found an example somewhere on Developer Disk 1.2 and used the following
> line in my c-program:
>
> char versiontag[] = "\0$VER: af_mksstv 0.1 (19.12.1999)";
>
> The name of the program is af_mksstv, the version should be 0.1 and the date
> of the source is Dec 19th 1999. When I type
>
> version af_mksstv FULL
>
> I see
>
> af_mksstv 0.1 (15.07.94)
>
> So whats wrong here?

You must be using an old "Version" command, i.e. a version of that
command older than V44 (as shipped with the AmigaOS 3.5 update). The
older versions did not handle the Y2K issue gracefully, let alone
accept year numbers beyond the range 78..99. What you're seeing in the
output is the result of the "Version" command adding 1900+1999 and
trying to make sense of the result. The result of course is subject
to a numeric overflow. I haven't checked the math, but the result
speaks for itself: it's absolutely wrong.
How can this problem be avoided? For this week, use two digits for
the year number. Starting with next week, you'll invariably have to
use four digit year numbers. You can't use "00" to represent "2000"
since the old "Version" command will then add 1900+0 and produce
equally invalid results as with 1900+2000.



Home: Olaf Barthel, Brabeckstrasse 35, D-30559 Hannover
Net: olsen@sourcery.han.de (Home), olsen@logicalline.com (Work)