FIX: /Og causes code to be created that throws an exception error

Article translations Article translations
Article ID: 329193 - View products that this article applies to.
This article was previously published under Q329193
Expand all | Collapse all

On This Page


/Og causes code to be created that throws the following exception error:
0xC0000092: Floating-point stack check


Service pack information

To resolve this problem, obtain the latest service pack for Microsoft Visual Studio .NET. For more information, click the following article number to view the article in the Microsoft Knowledge Base:
837234 List of bugs that are fixed in Visual Studio .NET 2002 Service Pack 1

Hotfix information

The English version of this fix has the file attributes (or later) that are listed in the following table. The dates and times for these files are listed in coordinated universal time (UTC). When you view the file information, it is converted to local time. To find the difference between UTC and local time, use the Time Zone tab in the Date and Time tool in Control Panel.
   Date         Time   Version      Size       File name
   01-Oct-2002  01:41  13.0.9528.0  1,306,624  C2.dll


Turn off /Og by using #pragma optimize("g", on/off).


Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section. This problem was first corrected in Visual Studio .NET 2002 Service Pack 1.


The following sample code reproduces the behavior:
#include <stdio.h>
#include <float.h>

int get_feet_inches(double *num_of_feet,double *num_of_inches)
    double inches,feet;
    int    fval,ival;
    feet   = *num_of_feet;
    inches = *num_of_inches;
    if (feet   < 0.) feet   = -feet;
    if (inches < 0.) inches = -inches;
    fval = (int) feet;
    ival = (int) inches;
    printf("feet = %d, inches = %d\n",fval,ival);
    return fval + ival;


Article ID: 329193 - Last Review: September 27, 2005 - Revision: 3.2
  • Microsoft .NET Framework 1.1
  • Microsoft Visual C++ .NET 2002 Standard Edition
  • Microsoft Visual Studio .NET 2002 Professional Edition
kbhotfixserver kbqfe kbvs2002sp1sweep kbvs2002sp1fix kberrmsg kbbug kbfix kbnetframe100presp2fix kbnetframe100presp3fix KB329193

Give Feedback


Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from