X-Recipient: archive-cygwin AT delorie DOT com X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00,SPF_PASS X-Spam-Check-By: sourceware.org Message-ID: <4A8D396D.8000209@gmail.com> Date: Thu, 20 Aug 2009 12:54:21 +0100 From: Dave Korn User-Agent: Thunderbird 2.0.0.17 (Windows/20080914) MIME-Version: 1.0 To: cygwin AT cygwin DOT com Subject: Re: find(1) memory leak in cygheap References: <20090819140322 DOT GB8713 AT ednor DOT casa DOT cgf DOT cx> <20090820083926 DOT GJ32408 AT calimero DOT vinschen DOT de> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com 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