This is the mail archive of the gcc-prs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: libstdc++/10283: operator new does not return null on some windows systems


The following reply was made to PR libstdc++/10283; it has been noted by GNATS.

From: Tim Prince <timothyprince at sbcglobal dot net>
To: zerovalintine at hotmail dot com, gcc-gnats at gcc dot gnu dot 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 at hotmail dot com wrote:
 > #include <cstdlib>
 > 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]