header.hpp 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /*
  2. * Distributed under the Boost Software License, Version 1.0.
  3. * (See accompanying file LICENSE_1_0.txt or copy at
  4. * https://www.boost.org/LICENSE_1_0.txt)
  5. *
  6. * Copyright (c) 2023 Andrey Semashev
  7. */
  8. #if !defined(BOOST_SCOPE_ENABLE_WARNINGS)
  9. #if defined(_MSC_VER) && !defined(__clang__)
  10. #pragma warning(push, 3)
  11. // unreferenced formal parameter
  12. #pragma warning(disable: 4100)
  13. // conditional expression is constant
  14. #pragma warning(disable: 4127)
  15. // function marked as __forceinline not inlined
  16. #pragma warning(disable: 4714)
  17. // decorated name length exceeded, name was truncated
  18. #pragma warning(disable: 4503)
  19. // qualifier applied to function type has no meaning; ignored
  20. #pragma warning(disable: 4180)
  21. // qualifier applied to reference type; ignored
  22. #pragma warning(disable: 4181)
  23. // unreachable code
  24. #pragma warning(disable: 4702)
  25. // destructor never returns, potential memory leak
  26. #pragma warning(disable: 4722)
  27. #elif (defined(__GNUC__) && !(defined(__INTEL_COMPILER) || defined(__ICL) || defined(__ICC) || defined(__ECC)) \
  28. && (__GNUC__ * 100 + __GNUC_MINOR__) >= 406) || defined(__clang__)
  29. // Note: clang-cl goes here as well, as it seems to support gcc-style warning control pragmas.
  30. #pragma GCC diagnostic push
  31. // unused parameter 'arg'
  32. #pragma GCC diagnostic ignored "-Wunused-parameter"
  33. // unused function 'foo'
  34. #pragma GCC diagnostic ignored "-Wunused-function"
  35. #if defined(__clang__)
  36. // template argument uses unnamed type
  37. #pragma clang diagnostic ignored "-Wunnamed-type-template-args"
  38. #endif // defined(__clang__)
  39. #endif
  40. #endif // !defined(BOOST_SCOPE_ENABLE_WARNINGS)