[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    Re: -fno-exceptions?
From:       Johannes Sixt <Johannes.Sixt () telecom ! at>
Date:       1999-05-29 20:02:03
[Download RAW message or body]

On Fri, 28 May 1999, you wrote:
>On 28-May-99 Johannes Sixt wrote:
>> For those who didn't notice, yet: As of egcs 1.1 operator new throws a
>> bad_alloc
>> if it cannot allocate enough space! For a program without explicit exception
>> handling (try-catch-blocks) the net effect is the same as was earlier:
>> program
>> termination. Except that now CHECK_PTR is unnecessary after a new (won't be
>> reached).
>
>Er, but don't sed out your CHECK_PTR calls, cos not everyone uses egcs !

Throwing out CHECK_PTR alltogether would hurt nobody in KDE: There 3 scenarios,
all of which basically amount to the same: User annoyance.
(1) If new throws an exception: Program terminates because it is never caught.
(2) If new returns NULL, and there's no CHECK_PTR: Program terminates due to
SIGSEGV.
(3) If new returns NULL, and there's CHECK_PTR: Program terminates because
CHECK_PTR calls abort or exit.

So there's only one way left to go in order to make really user friendly
programs:

Support exceptions and handle at least bad_alloc somewhere!!!!!!!!!!

This addresses the Trolls mainly!  A basic bad_alloc trap should go into
QApplication::exec() that just issues a message "Out of memory" and keeps going
on.

Just my humble opinion,
-- Hannes

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic