From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1242 invoked by alias); 8 Apr 2004 03:42:12 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 1235 invoked from network); 8 Apr 2004 03:42:11 -0000 Received: from unknown (HELO bache.ece.cmu.edu) (128.2.129.23) by sources.redhat.com with SMTP; 8 Apr 2004 03:42:11 -0000 Received: from FRODO.ECE.CMU.EDU (FRODO.ECE.CMU.EDU [128.2.133.83]) by bache.ece.cmu.edu (Postfix) with ESMTP id 2E3877A; Wed, 7 Apr 2004 23:42:11 -0400 (EDT) Date: Thu, 08 Apr 2004 03:42:00 -0000 From: Nilmoni Deb To: Jim Wilson Cc: gcc-bugs@gcc.gnu.org Subject: Re: g++ delete issue In-Reply-To: <4074B769.4070705@specifixinc.com> Message-ID: References: <40722AA9.8010608@ece.cmu.edu> <4074B769.4070705@specifixinc.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-SW-Source: 2004-04/txt/msg00702.txt.bz2 List-Id: On Wed, 7 Apr 2004, Jim Wilson wrote: > Nilmoni Deb wrote: > > My concern is that the compiler allows the explicit "delete &u" > > operation even though the variable u is not user allocated. Should > > the compiler be expected to give a warning/error message when such a > > statement appears ? > > In general, you will get better answers if you file bugs into our > bugzilla bug database rather than sending email to gcc-bugs. We don't > track bugs sent via email. http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14885 It will be nice if all future updates/opinions are posted to this bug instead of directly emailing me. > I don't have a copy of the C++ standard, so I can't comment definitively > on this. However, I can note that in general it is not possible for the > compiler to know how an object has been allocated in all cases. The > object might have been allocated in a different function for instance. > There might be multiple assignments to the variable under different > conditions, and it may not be obvious at compile time which one will > reach the delete. In such cases, language standards generally do not > require any warning/error at all, even for relatively simple cases like > this one. > -- > Jim Wilson, GNU Tools Support, http://www.SpecifixInc.com > >