public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libc/4033] New: mktime bug in Europe/Lisbon timezone
@ 2007-02-13 14:18 cvalente at spambob dot com
  2007-02-13 14:19 ` [Bug libc/4033] " cvalente at spambob dot com
                   ` (19 more replies)
  0 siblings, 20 replies; 21+ messages in thread
From: cvalente at spambob dot com @ 2007-02-13 14:18 UTC (permalink / raw)
  To: glibc-bugs

Consider the following C program:

----------*time.c*------------
#include <time.h>
#include <stdio.h>

int main(int argc, char* argv[]){
        struct tm t1;
        struct tm t2;

        /* midnight 26/SET/1976*/
        t1.tm_sec  = 0;
        t1.tm_min  = 0;
        t1.tm_hour = 0;
        t1.tm_mday = 26;
        t1.tm_mon  = 8;
        t1.tm_year = 76;

        /* midnight 25/SET/1976*/
        t2.tm_sec  = 0;
        t2.tm_min  = 0;
        t2.tm_hour = 0;
        t2.tm_mday = 25;
        t2.tm_mon  = 8;
        t2.tm_year = 76;

        printf("%li\n", mktime(&t1)-mktime(&t2));
        printf("%li\n", mktime(&t1)-mktime(&t2));

        return 0;
}

--------*time.c*------------

Compile and run it to get the output:
90000
86400

That is, the same function mktime (shouldn't have any side-effects) returns 
different values the second time it's called.

My timezone is Europe/Lisbon
My system is Linux/gentoo/x86
My glibc version is 2.4-r4

This behaviour has been reproduced in other Linux distributions.
In case this bug is not related with libc, but some other distributor of 
timezone files, please indicate where I should submit the bug.

Thank you.

-- 
           Summary: mktime bug in Europe/Lisbon timezone
           Product: glibc
           Version: 2.4
            Status: NEW
          Severity: minor
          Priority: P2
         Component: libc
        AssignedTo: drepper at redhat dot com
        ReportedBy: cvalente at spambob dot com
                CC: glibc-bugs at sources dot redhat dot com
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


http://sourceware.org/bugzilla/show_bug.cgi?id=4033

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2008-03-29  3:22 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-02-13 14:18 [Bug libc/4033] New: mktime bug in Europe/Lisbon timezone cvalente at spambob dot com
2007-02-13 14:19 ` [Bug libc/4033] " cvalente at spambob dot com
2007-02-13 14:24 ` sergio at sergiomb dot no-ip dot org
2007-02-17  6:43 ` drepper at redhat dot com
2007-02-17 16:44 ` sergio at sergiomb dot no-ip dot org
2007-02-21 19:13 ` sergio at sergiomb dot no-ip dot org
2007-02-21 19:16 ` drepper at redhat dot com
2007-02-22  5:20 ` sergio at sergiomb dot no-ip dot org
2007-02-22  5:26 ` sergio at sergiomb dot no-ip dot org
2007-02-22  5:29 ` sergio at sergiomb dot no-ip dot org
2007-02-22  6:06 ` drepper at redhat dot com
2007-02-22 15:04 ` sergio at sergiomb dot no-ip dot org
2007-02-22 15:17 ` drepper at redhat dot com
2007-02-22 15:52 ` jakub at redhat dot com
2007-03-30 13:26 ` sergio at sergiomb dot no-ip dot org
2007-03-30 14:19 ` drepper at redhat dot com
2007-03-30 14:47 ` sergio at sergiomb dot no-ip dot org
2007-03-30 14:50 ` drepper at redhat dot com
2008-02-15 17:31 ` sergio at sergiomb dot no-ip dot org
2008-03-05  2:52 ` sergio at sergiomb dot no-ip dot org
2008-03-29  3:22 ` sergio at sergiomb dot no-ip dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).