Microsoft KB Archive/87884

= FIX: F6099 Integer Overflow with /4I2 and /4Yb =

Article ID: 87884

Article Last Modified on 12/1/2003

-

APPLIES TO


 * Microsoft FORTRAN Compiler 4.0
 * Microsoft FORTRAN Compiler 4.01
 * Microsoft FORTRAN Compiler 4.1
 * Microsoft FORTRAN Compiler 5.0
 * Microsoft FORTRAN Compiler 5.1
 * Microsoft FORTRAN Compiler 4.1
 * Microsoft FORTRAN Compiler 5.0
 * Microsoft FORTRAN Compiler 5.1

-



This article was previously published under Q87884



SYMPTOMS
Programs compiled with the metacommands $STORAGE:2 (or the /4I2 option) and $DEBUG (or the /4Yb option) in Microsoft FORTRAN version 4.0, 4.01, 4.1, 5.0 or 5.1 under MS-DOS or version 4.1, 5.0 and 5.1 under OS/2 may incorrectly generate the following error:

Run-Time Error F6099: $DEBUG

INTEGER overflow



CAUSE
The code must contain an assignment to an array where the array index is greater than 32768. The $STORAGE:2 (/4I2 option) and $DEBUG metacommands (/4Yb option) cause the compiler to generate incorrect assembly code leading to a jump to the overflow error output routine.



RESOLUTION
To avoid this error, compile without either the $STORAGE:2 (/4I2 option) or the $DEBUG metacommand (/4Yb option).



STATUS
Microsoft has confirmed this to be a problem in FORTRAN versions 4.0, 4.01, 4.1, 5.0 and 5.1. This problem was corrected in FORTRAN PowerStation, version 1.0.



MORE INFORMATION
The following code reproduces the problem:

Sample Code
$debug $storage:2

integer*4 i     integer*1 ar(32768)

i=32768 ar(i)=1 end

Additional query words: 4.00 4.10 5.00 5.10 buglist5.10 fixlist1.00

Keywords: kbfix KB87884

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.