|
Boost : |
From: Bronek Kozicki (brok_at_[hidden])
Date: 2005-11-02 03:26:56
Jeff Garland wrote:
> Of course this doesn't help if the user project includes a headers that does
> something inline with one of these calls. So for date-time I've wrapped up the
> 'deprecated calls in the following magic:
>
> #if (defined(_MSC_VER) && (_MSC_VER >= 1400))
> #pragma warning(push) // preserve warning settings
> #pragma warning(disable : 4996) // disable deprecated localtime/gmtime warning
> on vc8
> #endif // _MSC_VER >= 1400
>
> //make the deprecated calls...
>
> #if (defined(_MSC_VER) && (_MSC_VER >= 1400))
> #pragma warning(pop) // restore warnings to previous state
> #endif // _MSC_VER >= 1400
(sorry for long citation, but I want to keep your solution visible)
I believe that this is best solution, that should be used in other
places in boost where we see these warnings. My opinion is based on
experience with very large project where each compiler warning is
treated as compilation error. We do have warnings (sometimes even in
std:: headers) , thus we disable specific warnings in specific places
where we believe particular warning is harmless. This allows our code
(several MLOC) to compile sucesfully.
B.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk