Boost logo

Boost :

Subject: Re: [boost] [gil] gcc fail with simple code
From: Christian Henning (chhenning_at_[hidden])
Date: 2018-03-28 20:44:48


Thanks Peter!

Our fix is based on Andrey's suggestions. So we are good.

type operator()(bits32s x) const { return
static_cast<bits32>(x)+(static_cast<bits32>(1)<<31); }

On Wed, Mar 28, 2018 at 3:47 PM, Peter Dimov via Boost <
boost_at_[hidden]> wrote:

> Christian Henning wrote:
>
> a += (1 << 31);
>>
>
> 1u << 31 to be on the safe side; 1 << 31 (shifting into the sign bit) is
> undefined by itself. (It was accidentally made defined by C++17 but will
> probably revert to undefined.)
>
> _______________________________________________
> 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