views:

38

answers:

0

When we use SEH with __finally block,
if we do return in __try block, it causes a local unwind.

To Local unwind, the system need to approximately 1000 instructions.
The local unwind causes a warning C6242. MSDN suggests using __leave keyword(with saving a return value).

But I don't think it's a good idea.
If we use __leave keyword, there will be many mistakes. (We often forget saving the return value)
Local unwind feature makes easy programming. But __leave don't.

When I write device driver, I use SEH for deallocating memory.
But the warning is annoying me.
Is the waring really necessary?

What do you prefer one?(Just return in try-block, or leave try-block)