Compiler Error C2822 (Windows CE 5.0)

Send Feedback

local unwind is not supported on this platform.

The Windows CE 5.0 implementation of Structured Exception Handling does not support a local unwind operation, which is required when prematurely leaving either the guarded section or the termination handler of a try-finally statement. If you need to leave the guarded section, use the __leave keyword. Leaving the termination handler prematurely can have undefined behavior and should be avoided.

The following code demonstrates two ways this error message can be generated.

 
int g;
 
int main(void)
{
    __try {
        if (g) return g; // requires local unwind
        g = 1;
    } __finally {
        if (g) return g; // undefined; requires local unwind
        g = 2;
    }
 
    return 0;
}

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.