begin_no_sanitize.hpp 972 B

1234567891011121314151617181920212223242526272829303132
  1. /* Copyright 2024 Joaquin M Lopez Munoz.
  2. * Distributed under the Boost Software License, Version 1.0.
  3. * (See accompanying file LICENSE_1_0.txt or copy at
  4. * http://www.boost.org/LICENSE_1_0.txt)
  5. *
  6. * See http://www.boost.org/libs/poly_collection for library home page.
  7. */
  8. #if BOOST_WORKAROUND(BOOST_GCC_VERSION,>=40900)||\
  9. BOOST_WORKAROUND(BOOST_CLANG,>=1)&&\
  10. (__clang_major__>3 || __clang_major__==3 && __clang_minor__ >= 8)
  11. /* https://github.com/boostorg/poly_collection/issues/15 */
  12. #define BOOST_POLY_COLLECTION_INSIDE_NO_SANITIZE
  13. #define BOOST_POLY_COLLECTION_NO_SANITIZE \
  14. __attribute__((no_sanitize("undefined")))
  15. /* UBSan seems not to be supported in some environments */
  16. #if defined(BOOST_GCC_VERSION)
  17. #pragma GCC diagnostic push
  18. #pragma GCC diagnostic ignored "-Wattributes"
  19. #elif defined(BOOST_CLANG)
  20. #pragma clang diagnostic push
  21. #pragma clang diagnostic ignored "-Wattributes"
  22. #endif
  23. #else
  24. #define BOOST_POLY_COLLECTION_NO_SANITIZE
  25. #endif