|
Boost : |
Subject: Re: [boost] Help needed in fixing warnings
From: Michael Fawcett (michael.fawcett_at_[hidden])
Date: 2009-11-09 15:54:36
On Mon, Nov 9, 2009 at 3:39 PM, Robert Ramey <ramey_at_[hidden]> wrote:
> Stewart, Robert wrote:
>>
>> While not as easy for you as some yet undiscovered change to
>> noncopyable, can't you just use the MSVC pragma warning dance around
>> your classes to quiet that warning in each case?
>
> Of course I can conditionaly include pragma for this compiler.
At that point, isn't it less work to just declare the copy c-tor and
the assignment operator private? The MSDN documentation says that
this will silence the warning. I guess it would have been nice of
them to look in base classes as well when considering this warning...
> The problem is that you start have to doing for all compilers
> and they've all got their own set of quirks. Â This makes the
> code harder to read, understand and maintain. Â You HAVE
> to do it sometimes to work around bogus compiler errors
> but I'm sort of reluctant to embark upon this to work around
> bogus compiler warnings. Â This raises the question about how
> to handle the "warning" that such and such a function has been
> "deprecated" when it actually hasn't and of course those
> warnings which are just hints that sometimes have to be
> knowingly violated.
>
> Basically, once you start considering this - it sort of
> takes on a life of its own.
I think the proper way to deal with those warnings is documentation
that states that Boost libraries may emit those warnings unless
_CRT_SECURE_NO_WARNINGS
_SCL_SECURE_NO_WARNINGS
are defined. C++ didn't deprecate those functions, Microsoft did, so
it's no longer Boost's concern.
--Michael Fawcett
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk