diff --git a/include/pybind11/numpy.h b/include/pybind11/numpy.h index 60034ae989..397e92769a 100644 --- a/include/pybind11/numpy.h +++ b/include/pybind11/numpy.h @@ -59,7 +59,13 @@ class LazyInitializeAtLeastOnceDestroyNever { 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(value_storage_); + PYBIND11_WARNING_POP } private: