[Top][All Lists]

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

Re: [Bug-gnulib] new module: timegm

From: Simon Josefsson
Subject: Re: [Bug-gnulib] new module: timegm
Date: Thu, 04 Sep 2003 00:09:39 +0200
User-agent: Gnus/5.1003 (Gnus v5.10.3) Emacs/21.3.50 (gnu/linux)

Paul Eggert <address@hidden> writes:

> Bruno Haible <address@hidden> writes:
>> Simon Josefsson wrote:
>> > I used gmtime_r() where available(*),
>> Yes, of course it's preferrable to use the MT-safe version of a function
>> if possible.
> Unfortunately many implementations of gmtime_r are buggy, and we don't
> have a good test for them.  This problem is already noted in
> lib/strftime.c.  Until we have a good test, we should punt and do as
> lib/strftime.c does: namely, use gmtime and avoid gmtime_r.

It is in mktime.c too, but for localtime vs localtime_r.

I found it rather disturbing, I want my library to be thread safe.  I
wonder if someone will ever take the time to write a good test if we
punt on it, or even be in a position to be able to write a good test.
If we do use gmtime_r where available, people would hopefully report
when it doesn't work and then we can find a good test.  If we use
gmtime, people might have subtle bugs in threaded application, and
even if they track down the source of the problems to the use of
gmtime, we cannot do anything about it until we have a good test.

reply via email to

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