INFO: Undocumented Warning C4509

Last reviewed: October 6, 1997
Article 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: '<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.

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 <function> 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


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: October 6, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.