|
Boost : |
Subject: Re: [boost] Current Guidance on Compiler Warnings?
From: Gavin Lambert (boost_at_[hidden])
Date: 2018-11-26 23:35:53
On 27/11/2018 12:02, Peter Dimov wrote:
> Gavin Lambert wrote:
>> On 27/11/2018 11:29, Steven Watanabe wrote:
>> > signed integer overflow has undefined behavior. unsigned integers
>> wrap. > This means that signed integers give the compiler more scope
>> for > optimization and/or runtime checks.
>>
>> I'm not aware of any compilers that actually do that, ...
>
> https://godbolt.org/z/QCgY9u
That shows different optimisation (the first is "return true", the
second is "return x != UINT_MAX"), but that doesn't contradict my statement.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk