Re: c++ char exceptions

2002-04-24 Thread Michael D. Crawford
You're right, I wasn't thinking, if an exception isn't caught before it leaves main it aborts the program. So maybe codewarrior has a bug! Mike On Tue, 2002-04-23 at 06:33, Lassi A. Tuura wrote: > > That shouldn't matter. At the worst it should mean that the exception is not > > caught by any

Re: c++ char exceptions

2002-04-23 Thread Lassi A. Tuura
> That shouldn't matter. At the worst it should mean that the exception is not > caught by any of the catch clauses given, so the "return 0" would be taken. It does matter -- in this case the exception was not handled, and therefore terminate() gets called, which probably called abort(). That i

RE: c++ char exceptions

2002-04-23 Thread Robert Collins
> -Original Message- > From: Michael D. Crawford [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, April 23, 2002 6:24 PM > > Usually throwing a pointer is not what you really want to do, > but it shouldn't > cause a crash. Is it worth putting this up as a bug on the gcc bugs database? R

Re: c++ char exceptions

2002-04-23 Thread Michael D. Crawford
> You threw const char* That shouldn't matter. At the worst it should mean that the exception is not caught by any of the catch clauses given, so the "return 0" would be taken. The only thing that should happen to an exception object after you're done with it is that objects thrown by value

Re: c++ char exceptions

2002-04-23 Thread Michael D. Crawford
It aborts with g++ 2.95.4 on Debian PowerPC Linux too. But if I compile it with CodeWarrior 6 on Windows it runs normally, doesn't crash, and gives the exit code of 1. I think CodeWarrior is correct, and that this is a bug in g++, but not in cygwin. Mike Thus it was written: I don't know if t

RE: c++ char exceptions

2002-04-23 Thread Robert Collins
> -Original Message- > From: Danny Smith [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, April 23, 2002 6:11 PM > > Robert wrote: > > > > I don't know if this is a cygwin issue or if I am doing something > > fundamentally wrong... > > > > You threw const char* Sigh. Blush. I should have

RE: c++ char exceptions

2002-04-23 Thread Danny Smith
Robert wrote: > > I don't know if this is a cygwin issue or if I am doing something > fundamentally wrong... > You threw const char* int main (int argc, char **argv) { try { throw "catch this"; } catch (const char *message) // ^ { return 1; } return