Boost logo

Boost :

From: SourceForge.net (noreply_at_[hidden])
Date: 2003-10-23 10:19:39


Bugs item #828980, was opened at 2003-10-23 19:19
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=107586&aid=828980&group_id=7586

Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Alexander Nasonov (alnsn)
Assigned to: Nobody/Anonymous (nobody)
Summary: comparisons in libs/thread/src/timeconv.inl

Initial Comment:
I alreary posted this bug to boost-devel:
http://lists.boost.org/MailArchives/boost/msg49265.php
no replies.
I see sourceforge bug system is alive. So I'm posting here.

In some cases ts.tv_nsec may have been assigned
NANOSECONDS_PER_SECOND ( == 1000000000). IMHO, more
correct behavoir is to increment ts.tv_sec and set
ts.tv_nsec to 0.

For example, to_timespec_duration has such code fragment:

if(ts.tv_nsec > static_cast<const
int>(NANOSECONDS_PER_SECOND))
{
    ts.tv_sec += ts.tv_nsec / NANOSECONDS_PER_SECOND;
    ts.tv_nsec %= NANOSECONDS_PER_SECOND;
}

which doesn't affect ts.tv_nsec if it is eqeal to
NANOSECONDS_PER_SECOND.
To avoid this effect less operator in first line should
be replaced with less-equal operator.
There are several similar places where ts.tv_nsec is
assigned in this inapropriate way. Not sure that they
all are in timeconv.inl file.

PS. after looking at the function one more time I
discovered that ts.tv_nsec is assigned a difference
between two nsec values. Can ts.tv_nsec ever reach
NANOSECONDS_PER_SECOND? Anyway, other functions should
be checked against this behavior.

PPS. Why there are no bug priorities list in the form?

----------------------------------------------------------------------

You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=107586&aid=828980&group_id=7586

-------------------------------------------------------
This SF.net email is sponsored by: The SF.net Donation Program.
Do you like what SourceForge.net is doing for the Open
Source Community? Make a contribution, and help us add new
features and functionality. Click here: http://sourceforge.net/donate/
_______________________________________________
Boost-bugs mailing list
Boost-bugs_at_[hidden]
https://lists.sourceforge.net/lists/listinfo/boost-bugs


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