|
-
January 25th, 2014, 06:03 AM
#2
Re: SEH hanlder cause compiler warnings and errors
Here are the causes and possible fixes, quoted from MSDN Library:
Compiler Warning C4509
nonstandard extension used: 'function' uses SEH and 'object' has destructor
You should not use structured exception handling in functions that use objects with destructors. If an exception occurs, the destructor cannot be called.
Use C++ exception handling instead.
Compiler Error C2712
cannot use __try in functions that require object unwinding
When you use /EHsc, a function with structured exception handling cannot have objects that require unwinding (destruction).
Possible solutions:
• Move code that requires SEH to another function
• Rewrite functions that use SEH to avoid the use of local variables and parameters that have destructors. Do not use SEH in constructors or destructors
• Compile without /EHsc
Last edited by ovidiucucu; January 25th, 2014 at 06:07 AM.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|