From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19222 invoked by alias); 8 Jan 2015 21:22:55 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 19199 invoked by uid 55); 8 Jan 2015 21:22:48 -0000 From: "olafvdspek at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/56126] -fno-exceptions should activate -fcheck-new or issue diagnostic for all new operators without throw() Date: Thu, 08 Jan 2015 21:22:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 4.6.3 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: olafvdspek at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2015-01/txt/msg00522.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56126 --- Comment #12 from Olaf van der Spek --- On Thu, Jan 8, 2015 at 10:20 PM, bruck.michael at googlemail dot com wrote: > throwing is undefined behavior with -fno-exceptions. Says who? > Allocation failure is a > simple error and should not kill your program. It's far from simple to handle properly and to do better then abort. >> BTW, what's your use case? Do you really want to check NULL on every >> call to new? > > With -fno-exceptions you have to check all functions for errors, including > allocation. What's your use case?