Boost logo

Boost :

Subject: Re: [boost] Towards a Warning free code policy proposal
From: Emil Dotchevski (emil_at_[hidden])
Date: 2010-08-30 14:22:25


On Mon, Aug 30, 2010 at 8:36 AM, Nevin Liber <nevin_at_[hidden]> wrote:
> On 29 August 2010 01:23, Emil Dotchevski <emil_at_[hidden]> wrote:
>
>>> Writing static_casts is annoying, but it is often necessary
>>> if you want to remain -Wall -pedantic.
>>
>> This is a good illustration of one of the problems with "fixing"
>> warnings: this is often done with casts, and casts are way more
>> dangerous than the built-in implicit conversions for which the
>> compiler is warning about.
>
> Is it really worse?  Here are the situations we are comparing:
>
> 1.  Silencing the warnings so that users and library developers can't
> look at them.
> 2.  Generating hundreds to thousands of warnings so that users and
> library developers don't look at them.
>
> The only way to effectively use warnings to look for problems is to
> have a zero warning policy.

I rarely "fix" warnings that interfere with my design decisions. For
example, I won't add a virtual destructor just to please the compiler,
I won't use a cast to silence a warning about a perfectly legal
implicit type conversion, and I can't even begin to think about
calling fopen_s.

My point is, in practice not all warnings can or should be fixed, and we need to

3. Use other means to prevent users from seeing such warnings.

...or we can ignore the problem altogether.

Emil Dotchevski
Reverge Studios, Inc.
http://www.revergestudios.com/reblog/index.php?n=ReCode


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