PRB: _chain_intr() Crashes When Compiling for 80386 Processor

ID: Q107429

1.00 1.50 WINDOWS kbprg kbprb

The information in this article applies to:

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

Last Reviewed: July 23, 1997