Amiga-C (120/223)

From:Jan-Erik Karlsson
Date:15 Aug 2001 at 12:55:34
Subject:[amiga-c] Re: GCC and exceptions...

Hello, Allan

On 15-Aug-01, you wrote:

AO > On Wed, 15 Aug 2001, Jan-Erik Karlsson wrote:
AO >
AO >>> If I change 'throw 42;' to just say 'throw;' then it only write
AO >>> above message once (but no 'catch in constructor'). If I
AO >>> constructor externally (A::A () { ... }) then it
AO >> works as it should, AO > and the same is the case if I move the
AO >> declaration of my class inside AO > the scope of main().
AO >> this is of no relevance to the compiler
AO >
AO > I don't understand this remark. Could you please elaborate?

I was tired and made a quick glance, and in this case with what we knew that
it should output and relatively simple example, where you would put the
class declaration would not change how gcc compiled the code.

AO >>> As you can imagine such fuzzy behaviour makes exceptions
AO >>> unreliable and thus useless for my project :-( I
AO >> tested it and it does work as it should you need to lower the
AO >> optimization level to 0
AO >> (you can still use the 'checkmark' optimizations), this is not a
AO >> stormc fault.

this is a general gcc fault (at least on ppc and 68k machines/amiga)

AO > ehm... I don't think the C++ standard say that exceptions should work
AO > different on different optimization levels... ;-) And setting level to
AO > zero is no optimizations at all. This is not very nice...

no but you can use the 'other' optimizations, most likely gcc mishandles
exceptions
I don't know if this is a known fault with gcc, I've looked at gnu.org and
tried to find something about it but can't find any mention of it either
generally or ppc/m68k specific (or in the gcc.guide file)

perhaps this should be reported to gnu.org?

With kind regards,
Jan-Erik Karlsson



Email: trg@privat.utfors.se
WWW: http://hem.fyristorg.com/TRG/
UIN (ICQ): 54667153


Fast ship? You've never heard of the Millenium Falcon?

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/