Subject: lib/24898: emacs thinks mktime is broken
To: None <>
From: None <>
List: netbsd-bugs
Date: 03/23/2004 23:50:53
>Number:         24898
>Category:       lib
>Synopsis:       emacs thinks mktime is broken
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    lib-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Mar 24 07:52:00 UTC 2004
>Originator:     Wolfgang S. Rupprecht
>Release:        NetBSD 1.6ZK
W S Rupprecht Computer Consulting, Fremont CA
System: NetBSD 1.6ZK NetBSD 1.6ZK (WSRCC_ATHLON) #3: Sun Mar 21 08:51:31 PST 2004 i386
Architecture: i386
Machine: i386
	emacs's configure prints out a message indicating that
	netbsd's mktime is broken.


    compile and run this code (snipped from

#include <stdio.h>
#include <stdlib.h>
#include <sys/time.h>
#include <time.h>
#include <unistd.h>

/* Fail if mktime fails to convert a date in the spring-forward gap.
   Based on a problem report from Andreas Jaeger.  */
main ()
  /* glibc (up to about 1998-10-07) failed this test) */
  struct tm tm;

  /* Use the portable POSIX.1 specification "TZ=PST8PDT,M4.1.0,M10.5.0"
     instead of "TZ=America/Vancouver" in order to detect the bug even
     on systems that don't support the Olson extension, or don't have the
     full zoneinfo tables installed.  */
  putenv ("TZ=PST8PDT,M4.1.0,M10.5.0");

  tm.tm_year = 98;
  tm.tm_mon = 3;
  tm.tm_mday = 5;
  tm.tm_hour = 2;
  tm.tm_min = 0;
  tm.tm_sec = 0;
  tm.tm_isdst = -1;
  if (mktime (&tm) == (time_t)-1){
      fprintf(stderr, "Death by rue-rue\n");
      exit (1);

  exit (0);