在 2022-03-30 04:53, Martin Storsjö 写道:

After some back-and-forth, we found that __mingw_setjmp/__mingw_longjmp do work in this case, but it is not obvious how to satisfy the conditions in the headers to switch to that implementation without switching the exception model, which seems like it could have some serious side-effects.

I was wondering if it might make sense to add a check for a
user-controllable define to override the implementation (something like
USE_NO_MINGW_SETJMP_TWO_ARGS seems to be intended to do) for situations
where code is generated at runtime without SEH tables.

Yup, such a mechanism makes perfect sense to me. Either invent a new one, or see if the existing ifdefs in the header can be fixed to work like it seems to be intended.



Does it make sense to use `__builtin_setjmp()` and `__builtin_longjmp()` here? I am not sure whether Clang supports these. On x86 they restore only the BP and SP registers (other caller-saved registers are not preserved) and do not unwind the stack, so technically they shall not appear in the same function.



--
Best regards,
LIU Hao

Attachment: OpenPGP_signature
Description: OpenPGP digital signature

_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to