From: <no...@so...> - 2001-05-18 02:26:58
|
Bugs item #425021, was updated on 2001-05-17 17:03 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=102435&aid=425021&group_id=2435 Category: gcc Group: Known bugs Status: Open Resolution: None Priority: 5 Submitted By: David Gravereaux (davygrvy) Assigned to: Nobody/Anonymous (nobody) Summary: Structured Exception Handling missing Initial Comment: Although Win32 SEH is an OS `feature`, it requires new language semantics: http://msdn.microsoft.com/library/devprods/vs6/visualc/ vccore/_core_exception_handling_topics_.28.seh.29.htm The attached file should compile with mingw. The M$VC++ understands it: D:\itcl_exp>cl -c SEHtest.c Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 12.00.8804 for 80x86 Copyright (C) Microsoft Corp 1984-1998. All rights reserved. sehtest.c D:\itcl_exp> MinGW does not: daveg@HALEAKALA d:/itcl_exp $ gcc -c -mno-cygwin SEHtest.c SEHtest.c: In function `SomeCloseProc': SEHtest.c:7: `__try' undeclared (first use in this function) SEHtest.c:7: (Each undeclared identifier is reported only once SEHtest.c:7: for each function it appears in.) SEHtest.c:7: parse error before `{' SEHtest.c: At top level: SEHtest.c:11: syntax error before `{' SEHtest.c:15: parse error before `1' SEHtest.c:18: parse error before `return' daveg@HALEAKALA d:/itcl_exp $ ---------------------------------------------------------------------- >Comment By: David Gravereaux (davygrvy) Date: 2001-05-17 19:26 Message: Logged In: YES user_id=7549 If it helps, and you have the free borland compiler, have a look in the include directory at excpt.h Oh! MSVC++6 has excpt.h as well. Three functions are defined: unsigned long __cdecl _exception_code(void); void * __cdecl _exception_info(void); int __cdecl _abnormal_termination(void); But the damn M$ guys didn't seem to put them in the c- runtime sources. I see exsup.inc and that's the closest I can find to what the intrinsics are. It appears that three asm files were used: exsup.asm, exsup2.asm, and exsup3.asm. The object files are there, but the source appears missing. ---------------------------------------------------------------------- Comment By: David Gravereaux (davygrvy) Date: 2001-05-17 19:25 Message: Logged In: YES user_id=7549 >Can you show me in the ANSI standard or any standard for >that matter where SEH is defined as "built-in language >statement"? Agreed! It won't be there. >I agree that SEH is useful and very important to some >users, and I wish I knew enough about assembly programming >to do something about it. But... Same. The author of LCC-Win32 added it and you might consider grabbing his source. His compiler doesn't support termination handlers, though. It coughs at __finally. http://www.q-software-solutions.com/lccwin32/ >BTW TCL 8.3.3 can be compiled with mingw, with a few simple >patches to the __try blocks, which essentially convert them >to no-ops. Crashes aren't handled very gracefully, but it >will compile and run. I have been intending to submit >patches to TCL but have been delayed by the change in host >of their site. Send bugs/patches to me or https://sourceforge.net/tracker/? group_id=10894 There's a new sticky-point in part of 8.4a2 that _requires_ the use of SEH to determine if a handle is valid. See http://cvs.sourceforge.net/cgi- bin/viewcvs.cgi/tcl/tcl/win/tclWinChan.c?rev=1.13&content- type=text/vnd.viewcvs-markup in Tcl_MakeFileChannel() about 3/4 the way down. I'm sure there's a better way to do that test, and I'll have to work on a solution to it, if SEH is a no-op. FYI, a Win2K OS bug caused that test to be added. Thanks for the input :) ---------------------------------------------------------------------- Comment By: Danny Smith (dannysmith) Date: 2001-05-17 17:43 Message: Logged In: YES user_id=11494 Can you show me in the ANSI standard or any standard for that matter where SEH is defined as "built-in language statement"? I agree that SEH is useful and very important to some users, and I wish I knew enough about assembly programming to do something about it. But... BTW TCL 8.3.3 can be compiled with mingw, with a few simple patches to the __try blocks, which essentially convert them to no-ops. Crashes aren't handled very gracefully, but it will compile and run. I have been intending to submit patches to TCL but have been delayed by the change in host of their site. Danny ---------------------------------------------------------------------- Comment By: David Gravereaux (davygrvy) Date: 2001-05-17 17:16 Message: Logged In: YES user_id=7549 SEHtest.c:7: `__try' undeclared (first use in this function) __try is not a function. __try is a built-in language statement, and has semantics, to implement SEH. __leave is only valid within a __try block. GetExceptionCode() is not a function either. It's a keyword only valid within the except filter. I could keep going on defining the rules, but I'll save my typing energy for other things :) Please don't consider this an M$ hack job. SEH is very important to some users, like myself. Tcl cannot be compiled by MinGW due to this missing feature. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=102435&aid=425021&group_id=2435 |