Boost logo

Boost :

Subject: Re: [boost] Official warnings policy?
From: Thomas Klimpel (Thomas.Klimpel_at_[hidden])
Date: 2009-11-04 14:28:44

Zachary Turner wrote:
> That aside, should we consider how to deal with #pragma warning(disable) in
> MSVC (do other compilers have similar pragmas)? Should it be disallowed?

No, it should not be disallowed.

The "warning C4127: conditional expression is constant" for a code like "if(op_type < 2)" where "op_type" is a template parameter is just nonsense.

> Otherwise it's all too easy for a library maintainer who doesn't want to
> fix a certain warning to just stick a pragma in there to disable it.

To be honest, often the fixing will be exactly the code that injects this pragma. And I don't think that it is necessarily easy:
#pragma warning(push)
#pragma warning(disable:4127)


#pragma warning(pop)

Boost list run by bdawes at, gregod at, cpdaniel at, john at