Boost logo

Boost Users :

From: Robert Ramey (ramey_at_[hidden])
Date: 2005-08-29 10:10:47

So should your change be made or not? I really couldn't follow your
argument but its an issue on which I'm prepared to rely 100% on the
judgement of someone who has considered it in much more detail than I have.

Robert Ramey

Daniel Krügler wrote:
> Daniel Krügler wrote:
>> The streaming inserter of Boost archive's dinkumware.hpp for
>> boost::int64_t causes indefinite recursion in case of negative
>> arguments. I think the following line inside the else clause should
>> be changed from
>> os << -t;
>> to
>> os << static_cast<boost::uint64_t>(-t);
>> Greetings from Bremen,
>> Daniel
> I apologize for incomplete information. The streaming inserter does
> not cause infinite recursion in **general** cases, but only in one
> special case: If the argument equals
> std::numeric_limits<boost::uint64_t>::min().
> This is a special case, because in 2-complement systems (I think, that
> is the only audience for that header) negating this value will return
> a negative number. From a general standpoint of C++ this is one
> special form of U.B., as described in section 6.2.5 of the C99
> standard (I have no older C standard available), but considering the
> code to be available only for the platform target I **assume**
> (contradictory opinions anywhere?) that the proposed code, which in
> general C++ would also cause U.B., uses platform specific behaviour
> to prevent that case.
> Greetinmgs from Bremen,
> Daniel Krügler

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at