Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Compiler Warning (level 1) C4530
Collapse the table of content
Expand the table of content

Compiler Warning (level 1) C4530

Error Message

C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc

C++ exception handling was used but /EHsc was not selected.

When the /EHsc option has not been enabled, an object with automatic storage in the frame, between the function doing the throw and the function catching the throw, will not be destroyed. However, an object with automatic storage created in a try or catch block will be destroyed.

The following sample generates C4530:

// C4530.cpp
// compile with: /W1
int main() {
   try{} catch(int*) {}   // C4530
}

Compile the sample with /EHsc to resolve the warning.

Community Additions

ADD
Show:
© 2015 Microsoft