./GContainer.h:860:10: warning: destination for this 'memset' call is a pointer to class containing a dynamic class 'GURL'; vtable pointer will be overwritten [-Wdynamic-class-memaccess]
Not a bug. At this point the memory buffer does not yet contain
anything. The vtable pointers for the actual objects are set on the next
line when the new instruction is called.
template<class ti=""> GCONT Node *
GListImpl<ti>::newnode(const TI &elt)
{
LNode n = (LNode ) operator new (sizeof(LNode ));</ti></class>
Status: open Group: djview Created: Fri Jan 07, 2022 10:29 AM UTC by dcb Last Updated: Fri Jan 07, 2022 10:29 AM UTC Owner: nobody
clang says:
./GContainer.h:860:10: warning: destination for this 'memset' call is
a pointer to class containing a dynamic class 'GURL'; vtable pointer
will be overwritten [-Wdynamic-class-memaccess]
Not a bug. At this point the memory buffer does not yet contain
anything. The vtable pointers for the actual objects are set on the next
line when the new instruction is called.
template<class ti=""> GCONT Node *
GListImpl<ti>::newnode(const TI &elt)
{
LNode n = (LNode ) operator new (sizeof(LNode ));</ti></class>
if GCONTAINER_ZERO_FILL
memset((void*)n, 0, sizeof(LNode ));
endif
new ((void)&(n->val)) TI(elt);
return (Node) n;
}
On 1/7/22 5:29 AM, dcb wrote:
Related
Bugs:
#343