This is the mail archive of the
gcc-prs@gcc.gnu.org
mailing list for the GCC project.
Re: libstdc++/10283: operator new does not return null on some windows systems
- From: Tim Prince <timothyprince at sbcglobal dot net>
- To: nobody at gcc dot gnu dot org
- Cc: gcc-prs at gcc dot gnu dot org,
- Date: 1 Apr 2003 06:16:01 -0000
- Subject: Re: libstdc++/10283: operator new does not return null on some windows systems
- Reply-to: Tim Prince <timothyprince at sbcglobal dot net>
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