cppcoreguidelines-pro-type-union-access
According to https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md using union for type-punning is undefined behaviour. Replace it with std::memcpy
This commit is contained in:
@@ -142,8 +142,7 @@ PyObject* PointsPy::addPoints(PyObject * args)
|
||||
|
||||
try {
|
||||
Py::Sequence list(obj);
|
||||
union PyType_Object pyType = {&(Base::VectorPy::Type)};
|
||||
Py::Type vType(pyType.o);
|
||||
Py::Type vType(Base::getTypeAsObject(&Base::VectorPy::Type));
|
||||
|
||||
for (Py::Sequence::iterator it = list.begin(); it != list.end(); ++it) {
|
||||
if ((*it).isType(vType)) {
|
||||
|
||||
Reference in New Issue
Block a user