Subject: Re: [boost] [chrono][ratio][boost_1_52_0_beta1] warning in user code
From: Vicente J. Botet Escriba (vicente.botet_at_[hidden])
Date: 2012-10-30 15:53:40


Le 30/10/12 19:56, Jeff Flinn a écrit :
> On 10/30/2012 11:56 AM, Vicente J. Botet Escriba wrote:
>> Le 30/10/12 07:25, Andrey Semashev a écrit :
>>> On Tue, Oct 30, 2012 at 3:15 AM, Vicente J. Botet Escriba
>>> <vicente.botet_at_[hidden]> wrote:
>> Maybe to avoid the warning we could replace the nan declaration by
>>
>> std::intmax_t nan= (ULL << (sizeof(intmax_t) * 8 - 1)) ;
>> by
>> std::intmax_t nan= (std::intmax_t)(1ULL << (sizeof(intmax_t) * 8 -
>> 1)) ;
>>
>> Note the constant 1ULL instead of 1LL. and of course that the output is
>> the same :)
>>
>> Please could you try it and see if the warning disappears?
>
> Yep, that clears up the warning. Thanks!
>
> static const boost::intmax_t nan = (boost::intmax_t)(1ULL <<
> (sizeof(boost::intmax_t) * CHAR_BIT - 1)) ;
>
> The above is what I used locally.
>
> Will this get into the boost 1.52.0 release?
>
>
Please could you create a ticket. I will commit the change after test so
that there are some chances to get this fixed on release.

Best,
Vicente