cvs.gedasymbols.org/archives/browse.cgi   search  
Mail Archives: djgpp/1997/06/12/18:19:40

From: "A. Sinan Unur" <asu1 AT cornell DOT edu>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Bug in DJGPP???
Date: Tue, 10 Jun 1997 22:30:53 -0400
Organization: Cornell University http://www.cornell.edu
Lines: 33
Sender: asu1 AT cornell DOT edu (Verified)
Message-ID: <339E0DDD.7E72@cornell.edu>
References: <3 DOT 0 DOT 16 DOT 19970611033103 DOT 3ac7c80e AT hem1 DOT passagen DOT se>
Reply-To: asu1 AT cornell DOT edu
NNTP-Posting-Host: cu-dialup-0029.cit.cornell.edu
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Peter Palotas wrote:
> 
> Hello, I am wondering how to make the operator "new" return NULL 
> instead of throwing an exception when trying to allocate more memory 
> than available.

> The following was cut from the C++ draft:
> 
>   T* p1 = new T;             // throws bad_alloc if it fails
>   T* p2 = new(nothrow) T;    // returns 0 if it fails
> 
> But the second example fails, saying that nothrow was undeclared. Is 
> this a bug in DJGPP or is there some special headerfile that has to be 
> included?

no, it is not a bug in djgpp ... djgpp is a port of gcc, as such it is
bound by what gcc supports ... i guess, as of 2.7.2.1, gcc does not
support the 'nothrow' option. i do not know if 2.8 supports it, i guess
you can check it out by going to fsf and searching. it takes time for
the standard to be implemented, you know.

and, btw, if you like djgpp so much, why the negative attitude?
-- 
   Sinan
 
*******************************************************************
 A. Sinan Unur                                WWWWWW
                                              |--O+O
 mailto:sinan DOT unur AT cornell DOT edu                C   ^ 
 http://www.people.cornell.edu/pages/asu1/     \  ~/ 

Unsolicited e-mail is _not_ welcome, and will be billed for.
*******************************************************************

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019