public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "olafvdspek at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
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	[thread overview]
Message-ID: <bug-56126-4-F5RbDBL66V@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-56126-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56126

--- Comment #12 from Olaf van der Spek <olafvdspek at gmail dot com> ---
On Thu, Jan 8, 2015 at 10:20 PM, bruck.michael at googlemail dot com
<gcc-bugzilla@gcc.gnu.org> 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?


  parent reply	other threads:[~2015-01-08 21:22 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-28  4:49 [Bug c++/56126] New: -fno-exceptions produces constructors that rely on exceptions to signal errors in operator new bruck.michael at googlemail dot com
2013-01-28  4:55 ` [Bug c++/56126] " pinskia at gcc dot gnu.org
2013-01-28  5:13 ` bruck.michael at googlemail dot com
2013-01-28  5:26 ` [Bug c++/56126] -fno-exceptions should activate -fcheck-new or issue diagnostic for all new operators without throw() bruck.michael at googlemail dot com
2015-01-03 18:11 ` olafvdspek at gmail dot com
2015-01-04  1:54 ` bruck.michael at googlemail dot com
2015-01-04 13:29 ` redi at gcc dot gnu.org
2015-01-04 13:43 ` redi at gcc dot gnu.org
2015-01-04 15:50 ` olafvdspek at gmail dot com
2015-01-06 13:22 ` bruck.michael at googlemail dot com
2015-01-07  0:26 ` olafvdspek at gmail dot com
2015-01-08 21:20 ` bruck.michael at googlemail dot com
2015-01-08 21:22 ` olafvdspek at gmail dot com [this message]
2015-01-09  0:46 ` redi at gcc dot gnu.org
2015-01-09  8:24 ` bruck.michael at googlemail dot com

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-56126-4-F5RbDBL66V@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).