Compiler Warning (level 1) C4532

 

For the latest documentation on Visual Studio 2017 RC, see Visual Studio 2017 RC Documentation.

'continue' : jump out of __finally/finally block has undefined behavior during termination handling

The compiler encountered one of the following keywords:

causing a jump out of a __finally or finally block during abnormal termination.

If an exception occurs, and while the stack is being unwound during execution of the termination handlers (the __finally or finally blocks), and your code jumps out of a __finally block before the __finally block ends, the behavior is undefined. Control may not return to the unwinding code, so the exception may not be handled properly.

If you must jump out of a __finally block, check for abnormal termination first.

The following sample generates C4532; simply comment out the jump statements to resolve the warnings.

// C4532.cpp  
// compile with: /W1  
// C4532 expected  
int main() {  
   int i;  
   for (i = 0; i < 10; i++) {  
      __try {  
      } __finally {  
         // Delete the following line to resolve.  
         continue;  
      }  
  
      __try {  
      } __finally {  
         // Delete the following line to resolve.  
         break;  
      }  
   }  
}  

Show: