Subject: Re: [boost] Current Guidance on Compiler Warnings?
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2018-11-26 22:29:35
On 11/26/2018 03:15 PM, Gavin Lambert via Boost wrote:
> On 27/11/2018 09:40, Emil Dotchevski wrote:
>> This is not what unsigned is for. You should generally use signed ints
>> if the value can't be negative.
> Why?Â Other than being less typing (which is, I think, the real
> mistake), what reason is there for this?
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.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk