FIX: F6099: Integer Overflow with $DEBUG & 32K INTEGER*2 ArrayLast reviewed: September 11, 1997Article ID: Q70654 |
4.00 4.01 4.10 5.00 | 4.10 5.00
MS-DOS | OS/2kbprg kbfixlist kbbuglist The information in this article applies to:
SYMPTOMSPrograms compiled with FORTRAN versions 4.0, 4.01, 4.1, and 5.0 that have an INTEGER*2 array dimensioned at exactly 32768 and that also access the last element of this array with a variable as a subscript, can give the following error during run time:
F6099: INTEGER overflowThese programs must be compiled with /4Yb or the $DEBUG metacommand to generate the error. If debug information is removed from the program, the code will run correctly.
RESOLUTIONOne possible solution is to increase the array size by one.
STATUSMicrosoft has confirmed this to be a problem in FORTRAN versions 4.0, 4.01, 4.1, and 5.0. This problem has been corrected in FORTRAN version 5.1.
MORE INFORMATIONThe following code reproduces the problem:
integer*4 i integer*2 n (32768) i=32768 n(i)=1 ! line 5 print*,n(32768) endAn integer overflow error is correctly flagged on line 5 when this code is compiled with /4Yb or $DEBUG. This program is overlowing since the array index must be multiplied by 4 to obtain the offset for the variable, since the machine is byte addressable. Increasing the dimension of the array by one also removes the integer overflow, as illustrated by the following program:
integer*4 i integer*2 n (32769) n(32768)=1 print*,n(32768) end |
Additional reference words: 5.00
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |