From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21071 invoked by alias); 1 Apr 2003 06:16:01 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 21053 invoked by uid 71); 1 Apr 2003 06:16:01 -0000 Date: Tue, 01 Apr 2003 06:16:00 -0000 Message-ID: <20030401061601.21050.qmail@sources.redhat.com> To: nobody@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org, From: Tim Prince Subject: Re: libstdc++/10283: operator new does not return null on some windows systems Reply-To: Tim Prince X-SW-Source: 2003-04/txt/msg00011.txt.bz2 List-Id: The following reply was made to PR libstdc++/10283; it has been noted by GNATS. From: Tim Prince To: zerovalintine@hotmail.com, gcc-gnats@gcc.gnu.org Cc: Subject: Re: libstdc++/10283: operator new does not return null on some windows systems Date: Mon, 31 Mar 2003 22:13:49 -0800 On Monday 31 March 2003 20:34, zerovalintine@hotmail.com wrote: > #include > int main(){ > char * s = new char[1024 * 1024 * 512]; > if(s != 0) delete[] s; > std::system(""); > return(0);} You may be ignored when you make a post with so many troll-like elements. Believe it or not, gcc doesn't check what OS you're running on or what run-time you're planning to link in when it optimizes code. If you consider your problem to be specific to mingw, then it's specific to the way mingw implements its interface to the Windows .dll's. If you consider it to be the code generated by gcc, you'll be able to see it by looking at the generated asm code. BTW, your example says "Aborted" when run under linux on my laptop. libc calls kill(). No way does gcc know that your code should be shortcut by calling kill() directly, if that's what you mean by optimizing. Nor is libstdc++ calling kill() directly. I'll check Windows later. -- Tim Prince