
Bronek Kozicki <brok@rubikon.pl> writes:
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.
If we want to go that way, we're going to need standard prefix and postfix headers that we #include in every Boost header: #ifndef INCLUDE-GUARD # define INCLUDE-GUARD # include <boost/config/prefix.hpp> ...your code here # include <boost/config/postfix.hpp> #endif // INCLUDE-GUARD Otherwise it will be totally unmaintainable. -- Dave Abrahams Boost Consulting www.boost-consulting.com