Microsoft KB Archive/103242: Difference between revisions

From BetaArchive Wiki
m (Text replacement - "<" to "<")
m (Text replacement - ">" to ">")
 
Line 13: Line 13:
The following warning was added to the Win32 beta SDK compiler and the Visual C++ 32-bit compiler version 1.0:
The following warning was added to the Win32 beta SDK compiler and the Visual C++ 32-bit compiler version 1.0:


<pre>  warning C4509: nonstandard extension used: '<function&gt;' uses SEH and
<pre>  warning C4509: nonstandard extension used: '<function>' uses SEH and
       '<variable&gt;' has destructor
       '<variable>' has destructor
</pre>
</pre>
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.
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.
Line 24: Line 24:
This warning is not documented in Microsoft Visual C++, 32-bit Edition, versions 1.0, 2.x, or 4.0.
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&gt; is MyFunction and the variable is mc, resembles the following .CPP file:
Code that produces the warning described above, where <function> is MyFunction and the variable is mc, resembles the following .CPP file:


<pre>  // compile with /c /W3
<pre>  // compile with /c /W3

Latest revision as of 09:14, 20 July 2020

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: '<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

Last Reviewed: October 6, 1997