Suppress gcc 4.8.5 (CentOS 7) warning.

```
include/pybind11/eigen/../numpy.h:63:53: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
         return *reinterpret_cast<T *>(value_storage_);
                                                     ^
```
This commit is contained in:
Ralf W. Grosse-Kunstleve 2023-10-09 07:00:47 -07:00
parent 109a1659c8
commit 88cec1152a

View File

@ -59,7 +59,13 @@ public:
initialized_ = true;
}
}
PYBIND11_WARNING_PUSH
#if !defined(__clang__) && defined(__GNUC__) && __GNUC__ < 5
// Needed for gcc 4.8.5
PYBIND11_WARNING_DISABLE_CLANG("-Wstrict-aliasing")
#endif
return *reinterpret_cast<T *>(value_storage_);
PYBIND11_WARNING_POP
}
private: