Menu

#343 GContainer.h:860: bad call to memset ?

djview
closed
nobody
None
5
2022-08-04
2022-01-07
dcb
No

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]

Related

Bugs: #343

Discussion

  • Leon Bottou

    Leon Bottou - 2022-01-07

    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:


    [bugs:#343] https://sourceforge.net/p/djvu/bugs/343/
    GContainer.h:860: bad call to memset ?

    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]


    Sent from sourceforge.net because you indicated interest in
    https://sourceforge.net/p/djvu/bugs/343/
    https://sourceforge.net/p/djvu/bugs/343/

    To unsubscribe from further messages, please visit
    https://sourceforge.net/auth/subscriptions/
    https://sourceforge.net/auth/subscriptions/

     

    Related

    Bugs: #343

  • Leon Bottou

    Leon Bottou - 2022-08-04
    • status: open --> closed
     

Log in to post a comment.

MongoDB Logo MongoDB