From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: =?ISO-8859-1?Q?Andreas_V=F6gele?= Newsgroups: gmane.lisp.guile.bugs Subject: Re: Patch for scm_strftime() in stime.c Date: Sun, 2 May 2004 21:46:13 +0200 Sender: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Message-ID: <5E7FD87F-9C71-11D8-BCCF-000D93673682@gmx.net> References: <633F02B4-9C47-11D8-BCCF-000D93673682@gmx.net> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 (Apple Message framework v613) Content-Type: multipart/mixed; boundary=Apple-Mail-27--6724892 X-Trace: sea.gmane.org 1083527817 3957 80.91.224.253 (2 May 2004 19:56:57 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 2 May 2004 19:56:57 +0000 (UTC) Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Sun May 02 21:56:53 2004 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1BKN53-0003Cv-00 for ; Sun, 02 May 2004 21:56:53 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.30) id 1BKN4L-0000mW-Ov for guile-bugs@m.gmane.org; Sun, 02 May 2004 15:56:09 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.30) id 1BKN1w-000878-KP for bug-guile@gnu.org; Sun, 02 May 2004 15:53:40 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.30) id 1BKN1M-0007uw-6s for bug-guile@gnu.org; Sun, 02 May 2004 15:53:35 -0400 Original-Received: from [213.165.64.20] (helo=mail.gmx.net) by monty-python.gnu.org with smtp (Exim 4.30) id 1BKN1L-0007tI-C7 for bug-guile@gnu.org; Sun, 02 May 2004 15:53:03 -0400 Original-Received: (qmail 13183 invoked by uid 65534); 2 May 2004 19:46:15 -0000 Original-Received: from pD9E61F7C.dip.t-dialin.net (EHLO [192.168.1.15]) (217.230.31.124) by mail.gmx.net (mp001) with SMTP; 02 May 2004 21:46:15 +0200 X-Authenticated: #14729429 In-Reply-To: <633F02B4-9C47-11D8-BCCF-000D93673682@gmx.net> Original-To: bug-guile@gnu.org X-Mailer: Apple Mail (2.613) X-BeenThere: bug-guile@gnu.org X-Mailman-Version: 2.1.4 Precedence: list List-Id: "Bug reports for GUILE, GNU's Ubiquitous Extension Language" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.lisp.guile.bugs:1386 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.bugs:1386 --Apple-Mail-27--6724892 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=ISO-8859-1; format=flowed Andreas V=F6gele wrote: > Hi, > > on HP-UX, test-suite/time.test fails. The problem is that there may be=20= > a mismatch between the time zone name and the daylight savings time=20 > setting. I thought about this problem. It's probably better to fix the test=20 instead of scm_strftime(). The test gets the local time and then sets=20 the time zone to "ZOW". The daylights savings time indicator, which is=20= currently set in Central Europe, is not unset. Since "ZOW" is not known=20= to be a time zone where dst is in effect the function strftime()=20 outputs an empty time zone name on HP-UX. BTW, that explains why the=20 time test didn't fail a couple of weeks ago. At that time dst wasn't in=20= effect in Central Europe. The patch that I sent this afternoon uses mktime() in scm_strftime() to=20= fix the tm_isdst field. But IMHO it's better to fix the test even if=20 that means that HP-UX and glibc-based systems behave differently in=20 some cases. Or do you think that scm_strftime() should silently fix=20 mismatches between the time zone name and dst? If yes, then I'd remove #idef __hpux since other systems might behave=20 similarly to HP-UX. On HP-UX, mktime() doesn't fail if the time zone=20 and dst mismatch. Instead, tm_isdst is modified. I don't know about=20 other systems, though. A patch for time.test is attached. --Apple-Mail-27--6724892 Content-Transfer-Encoding: 7bit Content-Type: application/octet-stream; x-unix-mode=0644; name="time.test.diff" Content-Disposition: attachment; filename=time.test.diff Index: time.test =================================================================== RCS file: /cvsroot/guile/guile/guile-core/test-suite/tests/time.test,v retrieving revision 1.1 diff -u -r1.1 time.test --- time.test 15 Jun 1999 14:09:53 -0000 1.1 +++ time.test 2 May 2004 19:20:39 -0000 @@ -24,5 +24,7 @@ (pass-if "strftime %Z doesn't return garbage" (let ((t (localtime (current-time)))) (vector-set! t 10 "ZOW") + ; Make sure that daylight savings time is disabled. + (vector-set! t 8 0) (string=? (strftime "%Z" t) "ZOW"))) --Apple-Mail-27--6724892 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Bug-guile mailing list Bug-guile@gnu.org http://mail.gnu.org/mailman/listinfo/bug-guile --Apple-Mail-27--6724892--