From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1819 invoked by alias); 13 Nov 2005 02:10:48 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 1798 invoked by uid 48); 13 Nov 2005 02:10:46 -0000 Date: Sun, 13 Nov 2005 02:10:00 -0000 Message-ID: <20051113021046.1797.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug c++/19476] Missed null checking elimination with new In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "pinskia at gcc dot gnu dot org" X-SW-Source: 2005-11/txt/msg01843.txt.bz2 List-Id: ------- Comment #6 from pinskia at gcc dot gnu dot org 2005-11-13 02:10 ------- (In reply to comment #5) > Is this safe? People can define their own operator new's, some of which may > return null... Yes because the normal operator new guarante not to return NULL by the C++ standard. And if it returns a NULL that is undefined behavior, it should be throwing an exception when memory could not be allocated (there is a nonthrow version which can and will return NULL). -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19476