This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: find(1) memory leak in cygheap


Haojun Bao wrote:

> 215  path_conv &operator =(path_conv& pc)
> 216  {
> 217    memcpy (this, &pc, sizeof pc);

  Ow yuck!  I very much hope nobody ever creates derived classes of path_conv
that introduce virtual functions into the base class, or we're going to have a
very tricky to find bug here.  (Hmm, now there's an idea.  GCC needs an
__attribute__ that you can tag onto a class to say it must be a POD-type and
get a compiler error if anyone ever adds a virtual function or anything else
that would make the layout non-POD.)

    cheers,
      DaveK


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]