Skip to content

Commit

Permalink
Avoid Wattributes false positives on older GCCs
Browse files Browse the repository at this point in the history
  • Loading branch information
igaztanaga committed Oct 7, 2024
1 parent 6995160 commit 35316d6
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions test/segment_manager_test.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,13 @@ using namespace boost::interprocess;
template<std::size_t Align>
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)\
template<>\
struct IntLike<A>\
Expand All @@ -57,6 +64,10 @@ BOOST_INTERPROCESS_ALIGNED_INTLIKE(256)

#undef BOOST_INTERPROCESS_ALIGNED_INTLIKE

#if defined(BOOST_GCC) && (BOOST_GCC <= 100000)
#pragma GCC diagnostic pop
#endif

template <class SegmentManager>
struct atomic_func_test
{
Expand Down

0 comments on commit 35316d6

Please sign in to comment.