[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Ssystem bug



>I take the blame on me...
>
>There's a bug in mkbuild.c that produces a bogus build.h.  This
>bug results in a bug of Ssystem (only for version 1.14.7):
>
>	Day of week | 1.14.7 | else (correct)
>	------------+--------+---------------
>	Monday      | 1      | 1
>	...         | ...    | ...
>	Saturday    | 6      | 6
>	Sunday      | 0 (!)  | 7
>
>	Month       | 1.14.7 | else (correct)
>	------------+--------+---------------
>	January     | 0      | 1
>	February    | 1      | 2
>	...         | ...    | ...
>	November    | 10     | 11
>	December    | 11     | 12
>
>Library bindings and other implementations should check the
>MiNT version especially if the values found are used as indexes
>into arrays.

According to my C Reference for localtime() the 1.14.7 version *is* correct
and the table above should read:

>	Day of week | 1.14.7 |
>	------------+--------+
>	Sunday      | 0      |
>	Monday      | 1      |
>	...         | ...    |
>	Saturday    | 6      |

As long as I can remember the week starts with Sunday and since programmers
start counting with 0 this is correct.

The strange thing is that the days in the month start with 1 for the first.
Who was smoking what when writing this function?  (It is ANSI C, not K&R)

BTW, does anyone remember when they changed the start of the year from
March to January and why? Calling the 9th month the seventh always confuses
me.

Axel

Axel Kielhorn
Smoking endangers your health
But it secures my job.
It's your choice!