Skip to content

Commit

Permalink
icetray - suppress dodgy gcc warning (#3551)
Browse files Browse the repository at this point in the history
GCC has a new-ish warning `-Wdangling-reference` that's part of `-Wall`.
While good in concept, it seems to suffer from too many false-positives.
This commit suppresses the warning here for all versions of GCC < 14.2.
Hopefully by then the false positives rate will have been addressed or
the warning is removed from `-Wall`.
  • Loading branch information
nega0 authored and nwhitehorn committed Jul 9, 2024
1 parent b439ca5 commit 30b1d9b
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions icetray/public/icetray/python/boost_serializable_pickle_suite.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,19 @@ struct boost_serializable_pickle_suite : boost::python::pickle_suite
{
static boost::python::tuple getstate(boost::python::object element_obj)
{

// as of gcc 14.1 -Wdangling-reference (included in -Wall) is still being
// ironed out. kick that can down the road.
#if __GNUC__ == 13 || \
(__GNUC__ == 14 && __GNUC_MINOR__ < 2)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdangling-reference"
#endif
const T &element = boost::python::extract<const T &>(element_obj)();
#if __GNUC__ == 13 || \
(__GNUC__ == 14 && __GNUC_MINOR__ < 2)
#pragma GCC diagnostic pop
#endif

// serialize the object into a buffer
std::vector<char> blobBuffer;
Expand Down

0 comments on commit 30b1d9b

Please sign in to comment.