delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1998/03/29/12:29:17

From: cj DOT waters AT auckland DOT ac DOT nz (Chris Waters)
Subject: Problems with exceptions in B19
29 Mar 1998 12:29:17 -0800 :
Message-ID: <3519913D.3BC01415.cygnus.gnu-win32@auckland.ac.nz>
Mime-Version: 1.0
To: gnu-win32 AT cygnus DOT com

Hi,

I can't get any of my code that uses exceptions to work under B19. Here
is an example:

#include <stdio.h>

class EError {
public:
  int dummy;
  EError(int a ) { dummy = a; };
};

int main( int argc, char *argv[]) {

  try {
    throw EError(argc); 
    printf("No exception\n");
  }
  catch (EError e) {
    printf("Caught exception %d\n", e.dummy);
  }


}

When I compile this with:

g++ -fexceptions test.cc

and run it the program stops with the message `aborted'. Any idea what's
up? This code works fine with gcc 2.7.2 on linux.


Thanks,

Chris Waters.
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request AT cygnus DOT com" with one line of text: "help".

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019