qvector.h:459:30: warning: destination for this 'memcpy' call is a
pointer to dynamic class 'QImage';
vtable pointer will be overwritten [-Wdynamic-class-memaccess]
::memcpy(dst, srcBegin, (srcEnd - srcBegin) * sizeof(T));
~~~~~~~~ ^
qvector.h:459:30: note: explicitly cast the pointer to silence
this warning
::memcpy(dst, srcBegin, (srcEnd - srcBegin) * sizeof(T));
^
(void*)
QImage inherits from QPaintDevice, which has virtual functions.
qimage.h declares QImage as a movable type, so
QTypeInfo<QImage>::isStatic is false. Hence, the memcpy codepath will
be reached when the vector is not shared.
We should trust that people declaring such type traits know what
they're doing, so silence the warning.
Change-Id: If36582f57a398fc237fb4bd4f72938fb09667118
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
new (dst++) T(*srcBegin++);
}
} else {
- ::memcpy(dst, srcBegin, (srcEnd - srcBegin) * sizeof(T));
+ ::memcpy(static_cast<void *>(dst), srcBegin, (srcEnd - srcBegin) * sizeof(T));
dst += srcEnd - srcBegin;
// destruct unused / not moved data