Okay, done. I sent the following to 'compi...@ca.ibm.com' with a Subject of " 
XLC documentation of new failures is mostly wrong" just now:

The documentation of failures of the new operator is inconsistent and mostly 
wrong.

The User’s Guide under LANGLVL(NEWEXCP) says “This option determines whether or 
not the C++ operator new throws an exception. When LANGLVL(NEWEXCP) is 
specified, the standard exception std::bad_alloc is thrown when the requested 
memory allocation fails. … The default setting is NONEWEXCP.” That is correct.

The Language Reference under new “Handling Allocation Failure” says “If you do 
not specify your own set_new_handler() function, new throws an
exception of type std::bad_alloc.” That is incorrect without the addition of 
“assuming you specify LANGLVL(NEWEXCP).”

The Library Reference under set_new_handler() says “If you have not registered 
a new-handler function, the default behavior is for the new operator to return 
NULL.” That is inconsistent with the Language Reference but it correct.

BTW, I believe the C++ standard calls for the NEWEXCP behavior. I think that 
should be the default behavior of the XLC compiler.

Please feel free to contact me if you have any questions.

Charles

-----Original Message-----
From: IBM Mainframe Discussion List [mailto:IBM-MAIN@LISTSERV.UA.EDU] On Behalf 
Of Tom Marchant
Sent: Thursday, January 22, 2015 5:11 AM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Re: What am I missing about C++ new[] failure?

On Wed, 21 Jan 2015 18:41:14 -0800, Charles Mills wrote:

>Geez, IBM -- the Language Reference and the Library Reference are in 
>conflict with each other and both incomplete. Both should reference 
>LANGLVL(NEWEXCP).

Please send in a RCF.

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

Reply via email to