Subject: Re: [boost] Towards a Warning free code policy proposal
From: Roland Bock (rbock_at_[hidden])
Date: 2010-08-30 14:32:14
On 08/27/2010 06:26 PM, vicente.botet wrote:
> I propose to extend this to a 2-level enabling warning system
> BOOST_ENABLE_WARNINGS: If defined, enable warnings for all the Boost libraries
> BOOST_<LIB>_ENABLE_WARNINGS: If defined, enable warnings for a specific library<LIB>
Switch the logic and I might agree:
BOOST_DISABLE_WARNINGS: If defined, disable warnings for all the Boost libraries
BOOST_<LIB>_DISABLE_WARNINGS: If defined, disable warnings for a specific library<LIB>
Turning off all warnings for boost by default would be madness IMO.
After all, the most libraries within boost are under development. Some
are pretty new. It is to be expected that some of the code will produce
warnings. It is important to have users report them, so that the code in
question can be be inspected and possibly fixed. It is like a continuous
The situation with boost warnings is impressive, anyway. In our company
we are currently using about 25 boost libraries in our code. And we get
no warnings. None. Zero. Zilch. Even though we are trying hard to get
them with gcc-4.4: -Wall -Wreorder -Wnon-virtual-dtor
-Wno-non-template-friend -Woverloaded-virtual -Wsign-promo -Wextra
I am sure, we will stumble upon new warnings some nice day in the not
too far away future, but my experience with warnings in boost is very good:
a) Most of the time, they are rather easy to fix
b) All the time, the respective developer is putting effort into fixing
reported warnings for the next release or maybe the one after that.
Essentially, the situation is getting better with each and every release
of boost. Awesome! It also sets an example for others.
But OK, if
- Someone simply cannot wait for a warning to get fixed
(for instance because a certain warning is driving him mad),
- Same someone is either not willing or not able to provide a
reasonable solution that takes care of the warning,
- Same someone is willing to assume that despite the warning
everything is just fine,
then (and I'd say only then), that someone would benefit from an option
to turn off all warnings.
Having the ability to turn off warnings, might be helpful under certain
conditions. But to turn them off by default would be a big mistake IMO.
Or, in other words, in contrast to mailing lists, opt-out should be
preferred over opt-in when it comes to warnings.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk