Boost logo

Boost Users :

Subject: [Boost-users] [date_time] cannot understand idea behind c_time::gmtime function
From: Roman Shmelev (rshmelev_at_[hidden])
Date: 2009-08-27 09:47:49


Hi! I've seen different behaviour under Windows and FreeBSD of the function
boost::date_time::c_time::gmtime

Looking inside it confused me: (Windows variant)

      inline
      static std::tm* gmtime(const std::time_t* t, std::tm* result)
      {
        // RESULT VALUE IS NOT USED. SO WHAT SENSE TO PASS ANYTHING HERE?
        result = std::gmtime(t);
        if (!result)
          boost::throw_exception(std::runtime_error("could not convert
calendar time to UTC time"));
        return result;
      }

Under FreeBSD everything is ok (gmtime_r is used).
So, probably it is a bug? I mean, the idea of cross-platform library -
is that functions will operate in similar way on different platforms.
Also, please look at documentation
http://www.boost.org/doc/libs/1_39_0/doc/html/boost/date_time/c_time.html
it says c_time has 4 functions (as I understand, 2 functions were
cloned :/ ) so it also seems to be a bug.


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net