warning_disable.hpp 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. // Copyright John Maddock 2008
  2. // Use, modification, and distribution is subject to the Boost Software
  3. // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
  4. // http://www.boost.org/LICENSE_1_0.txt)
  5. //
  6. // This file exists to turn off some overly-pedantic warning emitted
  7. // by certain compilers. You should include this header only in:
  8. //
  9. // * A test case, before any other headers, or,
  10. // * A library source file before any other headers.
  11. //
  12. // IT SHOULD NOT BE INCLUDED BY ANY BOOST HEADER.
  13. //
  14. // YOU SHOULD NOT INCLUDE IT IF YOU CAN REASONABLY FIX THE WARNING.
  15. //
  16. // The only warnings disabled here are those that are:
  17. //
  18. // * Quite unreasonably pedantic.
  19. // * Generally only emitted by a single compiler.
  20. // * Can't easily be fixed: for example if the vendors own std lib
  21. // code emits these warnings!
  22. //
  23. // Note that THIS HEADER MUST NOT INCLUDE ANY OTHER HEADERS:
  24. // not even std library ones! Doing so may turn the warning
  25. // off too late to be of any use. For example the VC++ C4996
  26. // warning can be emitted from <iosfwd> if that header is included
  27. // before or by this one :-(
  28. //
  29. #ifndef BOOST_CONFIG_WARNING_DISABLE_HPP
  30. #define BOOST_CONFIG_WARNING_DISABLE_HPP
  31. #if defined(_MSC_VER) && (_MSC_VER >= 1400)
  32. // Error 'function': was declared deprecated
  33. // http://msdn2.microsoft.com/en-us/library/ttcz0bys(VS.80).aspx
  34. // This error is emitted when you use some perfectly conforming
  35. // std lib functions in a perfectly correct way, and also by
  36. // some of Microsoft's own std lib code !
  37. # pragma warning(disable:4996)
  38. #endif
  39. #if defined(__INTEL_COMPILER) || defined(__ICL)
  40. // As above: gives warning when a "deprecated"
  41. // std library function is encountered.
  42. # pragma warning(disable:1786)
  43. #endif
  44. #endif // BOOST_CONFIG_WARNING_DISABLE_HPP