mirror of
https://github.com/pybind/pybind11.git
synced 2024-11-21 20:55:11 +00:00
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:
parent
109a1659c8
commit
88cec1152a
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user