[date_time] cannot understand idea behind c_time::gmtime function
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.
Also, I found that gmtime_r replacement for Windows could be gmtime_s ...
Hi, I recently submitted to Boost bug tracking system a patch for this... The issue is #3334: use of secure gmtime_s and localtime_s for vs2005 and up. You can track the progress of this issue using the following link : Ticket URL: https://svn.boost.org/trac/boost/ticket/3334 - Olivier - -----Original Message----- From: boost-users-bounces@lists.boost.org [mailto:boost-users-bounces@lists.boost.org] On Behalf Of Roman Shmelev Sent: Thursday, August 27, 2009 10:18 AM To: boost-users@lists.boost.org Subject: Re: [Boost-users] [date_time] cannot understand idea behind c_time::gmtime function Also, I found that gmtime_r replacement for Windows could be gmtime_s ... _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
It's great, Olivier! m.. do you think it's worth pointing in the same ticket about bug in documentation (4 functions instead of 2)?
You can track the progress of this issue using the following link : Ticket URL: https://svn.boost.org/trac/boost/ticket/3334
participants (2)
-
Olivier Courteau
-
Roman Shmelev