Boost logo

Boost :

Subject: Re: [boost] [serialization][1_42_0] basic_binary_oarchive - warning: comparison is always true due to limited range of data type
From: Robert Ramey (ramey_at_[hidden])
Date: 2010-04-06 13:29:52


Hmmm - what about a platform where int_least16_t is typedefed as a 32 bit
integer?
That is where int_least16_t can hold a value greater than 32K?

Robert Ramey

Jeff Flinn wrote:
> basic_binary_oarchive.hpp has this member:
>
> void save_override(const class_id_type & t, int){
> // upto 32K classes
> assert(t.t <=
> boost::integer_traits<boost::int_least16_t>::const_max); const
> boost::int_least16_t x = static_cast<const
> boost::int_least16_t>(t.t); * this->This() << x;
> }
>
> It doesn't seem that there is a need for this runtime assert at all
> given the definition:
>
> BOOST_ARCHIVE_STRONG_TYPEDEF(int_least16_t, class_id_type)
>
> Can't the assert be removed to quiet the gcc warning?
>
> Jeff
>
> _______________________________________________
> Unsubscribe & other changes:
> http://lists.boost.org/mailman/listinfo.cgi/boost


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