|
Boost : |
Subject: Re: [boost] Towards a Warning free code policy proposal
From: Jeffrey Lee Hellrung, Jr. (jhellrung_at_[hidden])
Date: 2010-08-27 14:34:32
On 8/27/2010 11:26 AM, Dave Abrahams wrote:
> On Fri, Aug 27, 2010 at 8:26 AM, vicente.botet<vicente.botet_at_[hidden]> wrote:
>> Hi all,
>>
>> Last year there where two long threads about Boost Warning policy. If I'm not wrong nothing was concluded. I think that we can have two warning policies: one respect to the Boost users and one internal for Boost developement.
>>
>> We can consider that Boost headers can be used by the users as system headers, so no warning is reported for these files. The main advantage I see is that it allows the users to don't mix the warnings comming from Boost and their own warnings.
>>
>> Next follows a way to disable completly warnings for 3 compilers: Any Boost header file could be surrounded by
>>
>> #if defined __GNUC__
>> #pragma GCC system_header
>> #elif defined __SUNPRO_CC
>> #pragma disable_warn
>> #elif defined _MSC_VER
>> #pragma warning(push, 1)
>> #endif
>>
>> and
>>
>> #if defined __SUNPRO_CC
>> #pragma enable_warn
>> #elif defined _MSC_VER
>> #pragma warning(pop)
>> #endif
>
> If we want to do something like that, it should be encapsulated in
> #include files:
>
> #include<boost/detail/header_prefix.hpp>
>
> ...
>
> #include<boost/detail/header_suffix.hpp>
I have never used the "GCC system_header" pragma, and have only gleaned
its purpose from this list. Based only on that, it doesn't sound like
you can stick it in an encapsulation header as above.
But other than that, yes, putting the MSVC and sun pragmas in
prefix/suffix files would be good.
- Jeff
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk