Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to disable MSVC exception workaround #936

Open
mtnpke opened this issue Oct 13, 2020 · 0 comments
Open

Allow to disable MSVC exception workaround #936

mtnpke opened this issue Oct 13, 2020 · 0 comments

Comments

@mtnpke
Copy link
Contributor

mtnpke commented Oct 13, 2020

gsl_assert automaticaly uses __fastfail instead of std::terminate if it detects that

  • the compiler is MSVC and
  • exceptions are disabled (either due to compilation in kernel mode or user mode with explicit disabling).

This is fine for the normal case (which I think is MSVC+Dinkumware), but in my case (MSVC+EASTL in kernel mode), it causes problems. I do want custom code to run on contract violation, which I can do by implementing std::terminate in a compatible way. However, I cannot achieve this since the autodetection overrules calling terminate. If I could define GSL_MSVC_USE_STL_NOEXCEPTION_WORKAROUND to 0 beforehand and thereby skip the autodetection, this would be very helpful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant