On Fri May 16 20:53:16 2025 +0000, Brendan Shanks wrote:
I'm sure others know more, but my understanding is that GCC/mingw doesn't support Windows SEH, hence the need for the mingw macros and Wine's own support. Clang does support SEH, although it doesn't look like Wine uses it (`__TRY` always uses `WINE_FRAME` except on MSVC). If Wine's macros used real SEH on Clang, an ASan build could just require Clang be used for PE cross-compiling and you could ignore `WINE_FRAME`.
I think GCC does support SEH? i.e. it will happily use it for C++ exceptions. (I contemplated suggesting using C++ but only for exception handling). It also generates enough SEH directives for functions so they can be unwound (urgh, i don't know the terminologies for these). That's why mingw's `__try1/__except1` work (to an extent).
And yes, clang does support `__try/__except`, but for windows targets only. wine also uses them on the unix side.