Boost logo

Boost :

From: Jeff Garland (jeff_at_[hidden])
Date: 2005-12-06 21:50:28


On Tue, 6 Dec 2005 15:55:15 -0500, Caleb Epstein wrote
> On 12/6/05, Norian N <noriann_at_[hidden]> wrote:
> >
> > I'm trying to use Boost 1.33 libs on x64 Windows platform. Have assert
> > break when try to use date below year 1900.
> >
> > _VALIDATE_RETURN( ( timeptr->tm_year >=0 ), EINVAL, FALSE)
>
> This is an issue with the Microsoft runtime libraries and not the
> fault of Boost.DateTime.
>
> There is absolutely no good reason for this check (IMHO). There is nothing
> in the strftime code (aside from these debugging assertions) that
> would fail on years prior to 1900, yet these assertions exist. I
> really wish they would remove them.

I have to agree with this. This is a result of recent MS changes that now
break code that works on many other platforms and previously worked on MS
platforms. I suppose someone ought to submit formal bug reports to complain.
 Only problem is AFAIK there is no C/C++ specification that says whether
negative values are allowed, so perhaps we need a LWG bug report to change the
standard. The whole reason we need to do this is so that we can send a tm
value into the standard facet for formatting. This makes working around the
problem in a generic way very difficult. So unfortunately, you might need to
consider using to_string or writing your own printing function if you are
using this particular platform. I suppose we are going to have to add more
portability notes as well....sigh....

Jeff


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk