Microsoft KB Archive/103242

From BetaArchive Wiki

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


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: '<function>' uses SEH and
      '<variable>' 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.


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 <function> is MyFunction and the variable is mc, resembles the following .CPP file:

   // compile with /c /W3

   struct MyClass {

   void myfunc()
           MyClass mc;




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