From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5391 invoked by alias); 23 Dec 2002 19:56:07 -0000 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org Received: (qmail 5384 invoked from network); 23 Dec 2002 19:56:05 -0000 Received: from unknown (HELO piper.synopsys.com) (146.225.1.217) by 209.249.29.67 with SMTP; 23 Dec 2002 19:56:05 -0000 Received: (from jbuck@localhost) by piper.synopsys.com (8.11.6/8.11.6) id gBNJtqv32023; Mon, 23 Dec 2002 11:55:52 -0800 Date: Mon, 23 Dec 2002 13:02:00 -0000 From: Joe Buck To: Craig Rodrigues Cc: gcc@gcc.gnu.org Subject: Re: 3.2.2 c++ compile problems Message-ID: <20021223115552.A31822@synopsys.com> References: <200212231718.MAA29417@bromo.msbb.uc.edu> <200212231800.NAA29533@bromo.msbb.uc.edu> <20021223132908.A8107@attbi.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <20021223132908.A8107@attbi.com>; from rodrigc@attbi.com on Mon, Dec 23, 2002 at 01:29:08PM -0500 X-SW-Source: 2002-12/txt/msg01366.txt.bz2 On Mon, Dec 23, 2002 at 01:29:08PM -0500, Craig Rodrigues wrote: > g++ 3.x conforms quite closely to Standard C++, so understanding > this standard will help you fix these types of problems. > > See the attached patch. Craig, your patch seems to assume that the compiler will always be GCC: you test for GCC 3, and otherwise explicitly declare new and delete in the global namespace (which is correct only for GCC 2). > #include // use size_t > > +#if __GNUC__ >= 3 > +#include > +using namespace std; > +#else > void *operator new(size_t size); > void operator delete(void *p); > > void *operator new[](size_t size); > void operator delete[](void *p); > +#endif This should probably be reversed, making GCC 2 the nonstandard environment to test for.