Boost logo

Boost :

Subject: Re: [boost] Current Guidance on Compiler Warnings?
From: Emil Dotchevski (emildotchevski_at_[hidden])
Date: 2018-11-26 20:48:12


On Mon, Nov 26, 2018 at 6:44 AM Marshall Clow via Boost <
boost_at_[hidden]> wrote:
> For example, should the following code cause a warning to be emitted?
>
> auto p = std::make_unique<unsigned char>(0);
>
> At least one popular compiler warns on this code, complaining about a
> truncation from int --> unsigned char, and a possible loss of data.
>
> We spent a lot of time and effort in Boost.DateTime with this.
> See https://github.com/boostorg/date_time/pull/50 and others.

Exactly. I submit that it is neither possible or desirable to write code
that will not result in warnings on some compiler. This is trivially true,
because there is no standard for warnings.

#pragma system_header is your friend.


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