/EH (Exception Handling Model)

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了/EH (Exception Handling Model)相关的知识,希望对你有一定的参考价值。

Specifies the kind of exception handling used by the compiler, when to optimize away exception checks, and whether to destroy C++ objects that go out of scope because of an exception. If /EH is not specified, the compiler catches both asynchronous structured exceptions and C++ exceptions, but does not destroy C++ objects that go out of scope because of an asynchronous exception.

/EH{s|a}[c][r][-]

a

The exception-handling model that catches both asynchronous (structured) and synchronous (C++) exceptions.

s

The exception-handling model that catches C++ exceptions only and tells the compiler to assume that functions declared as extern "C"may throw an exception.

c

If used with s (/EHsc), catches C++ exceptions only and tells the compiler to assume that functions declared as extern "C" never throw a C++ exception.

/EHca is equivalent to /EHa.

r

Tells the compiler to always generate runtime termination checks for all noexcept functions. By default, runtime checks for noexcept may be optimized away if the compiler determines the function calls only non-throwing functions.

 

 

more details:

https://msdn.microsoft.com/en-us/library/1deeycx5.aspx

以上是关于/EH (Exception Handling Model)的主要内容,如果未能解决你的问题,请参考以下文章

Error Handling and Exception

Exception-Handling

Exception handling

ruby exception_handling.rb

python handling-exception-example.py

Exception Handling