[Bug c++/56126] -fno-exceptions should activate -fcheck-new or issue diagnostic for all new operators without throw()

olafvdspek at gmail dot com gcc-bugzilla@gcc.gnu.org
Thu Jan 8 21:22:00 GMT 2015


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?



More information about the Gcc-bugs mailing list