PRB: _chain_intr() Crashes When Compiling for 80386 Processor

Last reviewed: July 22, 1997
Article ID: Q107429
1.00 1.50 WINDOWS kbprg kbprb

The information in this article applies to:

  • The C Run-time (CRT), included with: Microsoft Visual C++ for Windows, versions 1.0 and 1.5

SYMPTOMS

Calling the C run-time library function _chain_intr() causes an application to crash or behave unpredictably if the code is compiled with /G3 to target the 80386 processor.

CAUSE

The _chain_intr() function is written to be compatible with previous versions of the C run-time, and therefore the function expects only 16-bit registers to be pushed on the stack. With the /G3 compiler switch, the compiler needs to push and pop 32-bit registers instead of 16-bit registers because the code it generates or the code in functions it calls might modify a 32-bit register. The _chain_intr() function does not handle 32-bit registers, however, and is therefore usable only with processor models that use 16-bit registers, specifically /G0 through /G2.

RESOLUTION

If a call to _chain_intr() in an interrupt routine is not required, the /G3 compiler switch can be used. Otherwise, the allowable compiler switches are /G0 - /G2.


Additional reference words: 1.00 1.50
KBCategory: kbprg kbprb
KBSubcategory: CRTIss
Keywords : kb16bitonly


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: July 22, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.