The function my_tm_diff() in buildint_functions.c is bugged. It doesn't differentiate between months of different length, but treats all months as having 30 days, 10 hours and 30 minutes. This means that e.g. the dates 2004-01-31-12:00:00 and 2004-02-01-01:30:00 will be considered _equal_. The recent failures of the testsuite is due to these state of affairs. The bug can be reproduced with
mktime(gmtime(1075550400))
The bug is likely to occur with any date being the last day of a month containing 31 days, after 10:30 AM.
What about removing my_tm_diff and my_timegm completely and always use the mktime fallback in f_mktime?
/ Martin Nilsson (saturator)
Previous text:
2004-02-01 17:07: Subject: mktime
The function my_tm_diff() in buildint_functions.c is bugged. It doesn't differentiate between months of different length, but treats all months as having 30 days, 10 hours and 30 minutes. This means that e.g. the dates 2004-01-31-12:00:00 and 2004-02-01-01:30:00 will be considered _equal_. The recent failures of the testsuite is due to these state of affairs. The bug can be reproduced with
mktime(gmtime(1075550400))
The bug is likely to occur with any date being the last day of a month containing 31 days, after 10:30 AM.
/ Marcus Comstedt (ACROSS) (Hail Ilpalazzo!)
Would you mind much adding that to the testsuite so it stays yellow as long as the bug isn't fixed?
/ Mirar
Previous text:
2004-02-01 17:07: Subject: mktime
The function my_tm_diff() in buildint_functions.c is bugged. It doesn't differentiate between months of different length, but treats all months as having 30 days, 10 hours and 30 minutes. This means that e.g. the dates 2004-01-31-12:00:00 and 2004-02-01-01:30:00 will be considered _equal_. The recent failures of the testsuite is due to these state of affairs. The bug can be reproduced with
mktime(gmtime(1075550400))
The bug is likely to occur with any date being the last day of a month containing 31 days, after 10:30 AM.
/ Marcus Comstedt (ACROSS) (Hail Ilpalazzo!)
Well, I've now committed a test for that date, and a bunch of other dates that fail with the current CVS version. Frankly I don't share Grubba's belief that making my_tm_diff() more complex will make it less error prone...
/ Marcus Comstedt (ACROSS) (Hail Ilpalazzo!)
Previous text:
2004-02-02 11:29: Subject: mktime
Would you mind much adding that to the testsuite so it stays yellow as long as the bug isn't fixed?
/ Mirar
pike-devel@lists.lysator.liu.se