bug-guile
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

mktime error reporting


From: Kevin Ryde
Subject: mktime error reporting
Date: Sat, 08 Feb 2003 08:09:07 +1000
User-agent: Gnus/5.090013 (Oort Gnus v0.13) Emacs/21.2 (i386-pc-linux-gnu)

I noticed guile mktime includes errno in its error report, but I don't
think the C mktime sets errno.

For instance in guile 1.6.3 built on a recent i386 debian with glibc
2.3.1, a little foo.scm

        (readdir (opendir "."))
        (define tm (gmtime (current-time)))
        (set-tm:year tm -123)
        (mktime tm "GMT")

run with "guile -s foo.scm" gives the rather curious

        ERROR: In procedure mktime:
        ERROR: Success

Who'd have thought success was an error :-).

Of course readdir has set errno to 0 as part of its normal operation,
and mktime has returned -1 for a bogus tm_year, but not set errno.

I'm not actually sure what the standards say about mktime and errno,
but a draft of C99 I've seen doesn't mention it setting errno, and
certainly in glibc 2.3.1 it doesn't seem to get set.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]