NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

Compiler Warning (level 1) C4532

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

The compiler encountered one of the following keywords:

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

If an exception occurs, and while the stack is being unwound during execution of the termination handlers (the __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.

void main()
{
   // 2 warnings
   int i;
   for (i = 0; i < 10; i++) {
       __try {
       } __finally {
          continue;
       }

       __try {
       } __finally {
          break;
       }
   }

   // 1 warning
out1:
   __try {
   } __finally {
      goto out1;
   }

   // 1 warning
   __try {
   } __finally {
      goto out2;
   }
out2:

   // no warnings
   __try {
   } __finally {
in1:
      goto in1;
   }

   // no warnings
   __try {
   } __finally {
      goto in2;
in2:
      ;
   }

}