From: Luke D. <cod...@ho...> - 2002-05-15 09:08:07
|
It works when I run it. Is this the code you actually tried, or did you cut some pieces from a larger program without testing it? If you are throwing the exception from a DLL then the main program can't catch it unless you have a special library that is not included in standard Mingw (a DLL version of libgcc.a). If you are using function-try blocks, throwing from constructors or doing something else non-trivial please give a compilable test case that fails. Also, which versions of packages did you download? Try "gcc -v" and "ld -v". Luke Dunstan ----- Original Message ----- From: "MingW32 MingW32" <mi...@bi...> To: <min...@li...> Sent: Wednesday, May 15, 2002 4:34 PM Subject: [Mingw-users] Memory errors when handling an exception within a function Hello. I've got a function and I want to handle exceptions within it. If I handle exceptions within 'main', there are no errors, but if I try it within my_function, I get memory errors. ---------------//------------ void my_function() { ... if (x > 0) { int exception_local; exception_local = 1002; throw(exception_local);} //I get here memory errors } //main: try { ... if (!fileIN){ int exception_local; exception_local = 1001; throw(exception_local);} //I do not get any memory error ... externalfunction() ... } catch(int exception_local) { my_exception = exception_local; } ------------//-------------- What am I doing wrong? Thank you very much. ---------------------------------------------------------------------------- ---------------------------- ¿Conoces eBay, el mayor centro de compra y venta en internet? Móviles, portátiles, pda´s, cd´s, cámaras digitales, videocamaras... ¡Compra ahora a los mejores precios! http://ebay.hispavista.com ---------------------------------------------------------------------------- -------------------------- ¿Sabes si está libre tu dominio .info/.biz/.com/.org/.net/.es? ¿Quieres tener tu propio dominio y redirigirlo a tu espacio web en Galeon.com por 3,01 euros/mes? Gestiona tu dominio desde http://www.galeon.com ---------------------------------------------------------------------------- -------------------------- _______________________________________________________________ Have big pipes? SourceForge.net is looking for download mirrors. We supply the hardware. You get the recognition. Email Us: ban...@so... _______________________________________________ MinGW-users mailing list Min...@li... You may change your MinGW Account Options or unsubscribe at: https://lists.sourceforge.net/lists/listinfo/mingw-users |