Avoid Wattributes false positives on older GCCs

This commit is contained in:
Ion Gaztañaga
2024-10-07 23:13:40 +02:00
parent 69951601fb
commit 35316d6249

View File

@@ -34,6 +34,13 @@ using namespace boost::interprocess;
template<std::size_t Align> template<std::size_t Align>
struct IntLike; struct IntLike;
//Old GCC versions emit incorrect warnings like
//"requested alignment 256 is larger than 128"
#if defined(BOOST_GCC) && (BOOST_GCC <= 100000)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wattributes"
#endif
#define BOOST_INTERPROCESS_ALIGNED_INTLIKE(A)\ #define BOOST_INTERPROCESS_ALIGNED_INTLIKE(A)\
template<>\ template<>\
struct IntLike<A>\ struct IntLike<A>\
@@ -57,6 +64,10 @@ BOOST_INTERPROCESS_ALIGNED_INTLIKE(256)
#undef BOOST_INTERPROCESS_ALIGNED_INTLIKE #undef BOOST_INTERPROCESS_ALIGNED_INTLIKE
#if defined(BOOST_GCC) && (BOOST_GCC <= 100000)
#pragma GCC diagnostic pop
#endif
template <class SegmentManager> template <class SegmentManager>
struct atomic_func_test struct atomic_func_test
{ {