Microsoft KB Archive/103242

= INFO: Undocumented Warning C4509 =

ID: Q103242

The information in this article applies to:


 * The Microsoft C/C++ Compiler (CL.EXE) included with: - Microsoft Visual C++, 32-bit Edition, versions 1.0, 2.0, 4.0

SUMMARY
The following warning was added to the Win32 beta SDK compiler and the Visual C++ 32-bit compiler version 1.0:

warning C4509: nonstandard extension used: ' ' uses SEH and ' ' has destructor The warning was added in anticipation that C/C++ version 9.0 (included with Visual C++ 32-bit Edition, version 1.0) would support C++ exception handling (C++ EH). With the C/C++ compiler version 9.0, it is not possible to mix C++ EH and structured exception handling (SEH). Because destructors will involve C++ EH so that they can be called in an exception unwind, it will not be possible to have a local object in a function that uses SEH.

Currently, we do not destruct objects in an exception unwind.

MORE INFORMATION
This warning is not documented in Microsoft Visual C++, 32-bit Edition, versions 1.0, 2.x, or 4.0.

Code that produces the warning described above, where is MyFunction and the variable is mc, resembles the following .CPP file:

// compile with /c /W3

struct MyClass { public: MyClass; ~MyClass; };

void myfunc {          MyClass mc;

__try {          //..           }

__finally {        //..           }

} Additional query words: 8.00 9.00

Keywords         : kberrmsg Version          : WINNT:1.0,2.0,2.1,4.0; Platform         : NT WINDOWS Issue type       : kbinfo Last Reviewed: October 6, 1997