Boost logo

Boost :

From: Paul A. Bristow (boost_at_[hidden])
Date: 2003-08-08 14:40:40


| -----Original Message-----
| From: boost-bounces_at_[hidden]
| [mailto:boost-bounces_at_[hidden]]On Behalf Of Beman Dawes
| Sent: Friday, August 08, 2003 1:31 PM
| To: Boost mailing list; boost_at_[hidden]
| Subject: Re: [boost] Re: Re: time_duration bug in Boost 1.30.0
|
|
| At 05:27 PM 8/7/2003, Bo Persson wrote:
| >
| >"Paul A. Bristow" <boost_at_[hidden]> wrote:
| >
| >>
| >> (And other MS specific unhelpful warnings which could be dealt with
| >by
| >>
| >> #ifdef _MSC_VER or BOOST_?
| >> #pragma warning (disable : 4800) // inefficient bool conversion?
| >> #endif
| >>
| >> As a general point, is there any reason why 'known to be unhelpful'
| >> warnings like this cannot be disabled in Boost code?
| >>
| >
| >A problem here is that the "inefficient bool conversion" often
| >actually *is* an inefficient implicit conversion to bool. IME, most of
| >these warnings can be removed by actually producing a bool value.
| >Adding == 0 or != 0 is often all it takes.
|
| FWIW, I've done that for years in my own code, and have come to believe
| that it results in better code. It makes the intent clear to someone
| reading the code. With an implicit conversion, a reader is unsure whether
| or not the conversion was intended.
|
| To answer Paul's question, some of the toolsets do disable "known to be
| unhelpful" warnings. But I agree with Bo that this warning shouldn't be one
| of them.
|
| --Beman

Agree with everything the previous speakers have said.

Can we document our preference for Boost code to compile warning free in strict
mode
(MSVC, correct for loop scope, no language extensions and warnings level 4)?

I sense that accepting the MS defaults(incorrect for loop scope, language
extensions and warnings level 3) is not setting the bar as high as we reasonably
could.

Of course, it won't always be possible, but from much Boost code, I believe that
with a very small additional effort by authors, much code could meet this
standard.

Paul

Paul A Bristow, Prizet Farmhouse, Kendal, Cumbria, LA8 8AB UK
+44 1539 561830 Mobile +44 7714 33 02 04
Mobile mailto:pabristow_at_[hidden]
mailto:pbristow_at_[hidden]


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