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:
@@ -231,8 +231,7 @@ Py::Object CommandPy::getPlacement(void) const
|
||||
|
||||
void CommandPy::setPlacement(Py::Object arg)
|
||||
{
|
||||
union PyType_Object pyType = {&(Base::PlacementPy::Type)};
|
||||
Py::Type PlacementType(pyType.o);
|
||||
Py::Type PlacementType(Base::getTypeAsObject(&(Base::PlacementPy::Type)));
|
||||
if(arg.isType(PlacementType)) {
|
||||
getCommandPtr()->setFromPlacement( *static_cast<Base::PlacementPy*>((*arg))->getPlacementPtr() );
|
||||
parameters_copy_dict.clear();
|
||||
|
||||
Reference in New Issue
Block a user