Package: libc6 Version: 2.3.6.ds1-8 Severity: normal When tm_isdst is negtive (which means "information is not available" according to info), mktime() does not return -1 for some broken-down time that cannot be represented as a time_t (int32 in my box) calendar time. Instead mktime() return a closest tv (MIN_TIME_T or MAX_TIME_T), and normalize it's argument, and set tm_isdst to 0. While according to doc and to POSIX it should just return (time_t)-1.
Here is a test program I use to reproduce the bug: {{{ #include <time.h> #include <stdio.h> int main(int argc, char *argv[]) { struct tm ts; time_t tv; ts.tm_year = 1898 - 1900; ts.tm_mon = 12 - 1; ts.tm_mday = 28; ts.tm_hour = 0; ts.tm_min = 0; ts.tm_sec = 0; ts.tm_isdst = -1; tv = mktime(&ts); fprintf(stderr, "test one, year 1898, tv should be -1\n"); fprintf(stderr, "tv = %d, y = %d, m = %u, d = %u, h = %u, m = %u, sec = %u, dst = %d\n", tv, ts.tm_year, ts.tm_mon, ts.tm_mday, ts.tm_hour, ts.tm_min, ts.tm_sec, ts.tm_isdst); ts.tm_isdst = -1; ts.tm_year = 2046 - 1900; ts.tm_mon = 12 - 1; ts.tm_mday = 28; ts.tm_hour = 0; ts.tm_min = 0; ts.tm_sec = 0; tv = mktime(&ts); fprintf(stderr, "test two, year 2046, tv should be -1\n"); fprintf(stderr, "tv = %d, y = %d, m = %u, d = %u, h = %u, m = %u, sec = %u, dst = %d\n", tv, ts.tm_year, ts.tm_mon, ts.tm_mday, ts.tm_hour, ts.tm_min, ts.tm_sec, ts.tm_isdst); } }}} my gcc version: gcc (GCC) 4.1.2 20061115 (prerelease) (Debian 4.1.1-20) -- System Information: Debian Release: 4.0 APT prefers unstable APT policy: (500, 'unstable') Architecture: i386 (i686) Shell: /bin/sh linked to /bin/bash Kernel: Linux 2.6.18-3-686 Locale: LANG=zh_CN.UTF-8, LC_CTYPE=zh_CN.UTF-8 (charmap=UTF-8) Versions of packages libc6 depends on: ii tzdata 2006p-1 Time Zone and Daylight Saving Time libc6 recommends no packages. -- no debconf information -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]