This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug libc/13148] New: localtime doesn't support more than 67768036191705599 seconds
- From: "hjl.tools at gmail dot com" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sources dot redhat dot com
- Date: Thu, 01 Sep 2011 20:01:30 +0000
- Subject: [Bug libc/13148] New: localtime doesn't support more than 67768036191705599 seconds
- Auto-submitted: auto-generated
http://sourceware.org/bugzilla/show_bug.cgi?id=13148
Bug #: 13148
Summary: localtime doesn't support more than 67768036191705599
seconds
Product: glibc
Version: 2.14
Status: NEW
Severity: normal
Priority: P2
Component: libc
AssignedTo: drepper.fsp@gmail.com
ReportedBy: hjl.tools@gmail.com
Classification: Unclassified
On Linux/x86-64, I got
[hjl@gnu-mic-1 lfs-1]$ cat foo.c
#include <time.h>
#include <stdio.h>
static void
foo (time_t *tp)
{
struct tm *p = localtime (tp);
if (!p)
printf ("localtime (0x%lx) is NULL\n", *tp);
else
printf ("localtime (0x%lx): year: %d\n", *tp, p->tm_year);
}
int
main ()
{
time_t t;
t = 67768036191705599L;
foo (&t);
t++;
foo (&t);
return 0;
}
[hjl@gnu-mic-1 lfs-1]$ gcc foo.c
[hjl@gnu-mic-1 lfs-1]$ ./a.out
localtime (0xf0c2ab7c5519ff): year: 2147483647
localtime (0xf0c2ab7c551a00) is NULL
[hjl@gnu-mic-1 lfs-1]$
--
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.