header.hpp 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. /*
  2. * Copyright Andrey Semashev 2007 - 2015.
  3. * Distributed under the Boost Software License, Version 1.0.
  4. * (See accompanying file LICENSE_1_0.txt or copy at
  5. * http://www.boost.org/LICENSE_1_0.txt)
  6. */
  7. #include <boost/config/abi_prefix.hpp>
  8. #if !defined(BOOST_LOG_ENABLE_WARNINGS)
  9. #if defined(_MSC_VER) && !defined(__clang__)
  10. #pragma warning(push, 3)
  11. // 'm_A' : class 'A' needs to have dll-interface to be used by clients of class 'B'
  12. #pragma warning(disable: 4251)
  13. // non dll-interface class 'A' used as base for dll-interface class 'B'
  14. #pragma warning(disable: 4275)
  15. // switch statement contains 'default' but no 'case' labels
  16. #pragma warning(disable: 4065)
  17. // 'this' : used in base member initializer list
  18. #pragma warning(disable: 4355)
  19. // 'int' : forcing value to bool 'true' or 'false' (performance warning)
  20. #pragma warning(disable: 4800)
  21. // unreferenced formal parameter
  22. #pragma warning(disable: 4100)
  23. // conditional expression is constant
  24. #pragma warning(disable: 4127)
  25. // default constructor could not be generated
  26. #pragma warning(disable: 4510)
  27. // copy constructor could not be generated
  28. #pragma warning(disable: 4511)
  29. // assignment operator could not be generated
  30. #pragma warning(disable: 4512)
  31. // struct 'A' can never be instantiated - user defined constructor required
  32. #pragma warning(disable: 4610)
  33. // function marked as __forceinline not inlined
  34. #pragma warning(disable: 4714)
  35. // decorated name length exceeded, name was truncated
  36. #pragma warning(disable: 4503)
  37. // declaration of 'A' hides previous local declaration
  38. #pragma warning(disable: 4456)
  39. // declaration of 'A' hides global declaration
  40. #pragma warning(disable: 4459)
  41. // 'X': This function or variable may be unsafe. Consider using Y instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
  42. #pragma warning(disable: 4996)
  43. #elif (defined(__GNUC__) && !(defined(__INTEL_COMPILER) || defined(__ICL) || defined(__ICC) || defined(__ECC)) \
  44. && (__GNUC__ * 100 + __GNUC_MINOR__) >= 406) || defined(__clang__)
  45. // Note: clang-cl goes here as well, as it seems to support gcc-style warning control pragmas.
  46. #pragma GCC diagnostic push
  47. // 'var' defined but not used
  48. #pragma GCC diagnostic ignored "-Wunused-variable"
  49. // unused parameter 'arg'
  50. #pragma GCC diagnostic ignored "-Wunused-parameter"
  51. // missing initializer for member var
  52. #pragma GCC diagnostic ignored "-Wmissing-field-initializers"
  53. #if (__GNUC__ * 100 + __GNUC_MINOR__) >= 407
  54. // typedef 'foo' locally defined but not used
  55. #pragma GCC diagnostic ignored "-Wunused-local-typedefs"
  56. #endif
  57. #if defined(__clang__)
  58. // the argument to '__builtin_assume' has side effects that will be discarded
  59. #pragma clang diagnostic ignored "-Wassume"
  60. #endif // defined(__clang__)
  61. #endif
  62. #endif // !defined(BOOST_LOG_ENABLE_WARNINGS)