From owner-freebsd-alpha Sun Apr 1 13: 7: 9 2001 Delivered-To: freebsd-alpha@freebsd.org Received: from dragon.nuxi.com (trang.nuxi.com [209.152.133.57]) by hub.freebsd.org (Postfix) with ESMTP id 2D75337B719 for ; Sun, 1 Apr 2001 13:07:07 -0700 (PDT) (envelope-from obrien@NUXI.com) Received: (from obrien@localhost) by dragon.nuxi.com (8.11.3/8.11.1) id f31K73861269; Sun, 1 Apr 2001 13:07:03 -0700 (PDT) (envelope-from obrien) Date: Sun, 1 Apr 2001 13:07:02 -0700 From: "David O'Brien" To: Marcin Gryszkalis Cc: freebsd-alpha@freebsd.org Subject: Re: gperf segfail on 4.3b Message-ID: <20010401130702.A60525@dragon.nuxi.com> Reply-To: obrien@freebsd.org References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: ; from dagoon@math.uni.lodz.pl on Sun, Apr 01, 2001 at 05:54:42PM +0200 X-Operating-System: FreeBSD 5.0-CURRENT Organization: The NUXI BSD group X-Pgp-Rsa-Fingerprint: B7 4D 3E E9 11 39 5F A3 90 76 5D 69 58 D9 98 7A X-Pgp-Rsa-Keyid: 1024/34F9F9D5 Sender: owner-freebsd-alpha@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org On Sun, Apr 01, 2001 at 05:54:42PM +0200, Marcin Gryszkalis wrote: > Ok, seems like I have a real problem: this source: > ----------------------------------------------- > gives 'CCWWWD' as result while it should 'CCCWWWDD'. Constructor and > destructor for d0 are NOT called. How do you know which ctor/dtor is being called with the way you wrote this? Try this version: #include class dg { char *n; public: dg(){n=""; puts("C'");} dg(char *s){n=s; printf("C%s\n",n);} ~dg() {printf("D%s\n",n);} void work(char *s){printf("W%s\n",s);} }; dg d0("0"); int main (int argc, char *argv[]) { dg d1("1"); dg *d2=new dg("2"); d0.work("0"); d1.work("1"); d2->work("2"); return 0; } I believe you mean dtor for d2 NOT called -- you never delete the pointer, so how could it get called? x86 -current: C0 C1 C2 W0 W1 W2 D1 D0 x86 4.3-RC#2: C0 C1 C2 W0 W1 W2 D1 D0 Alpha 4.3-RC#2: C0 C1 C2 W0 W1 W2 D1 D0 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-alpha" in the body of the message