FIX: Incorrect Result Initializing INTEGER*1 ArrayLast reviewed: September 11, 1997Article ID: Q72920 |
4.00 4.01 4.10 5.00 5.10 | 4.10 5.00 5.10
MS-DOS | OS/2kbtool kbfixlist kbbuglist The information in this article applies to:
SYMPTOMSPrograms compiled with Microsoft FORTRAN versions 4.0, 4.01, 4.1, 5.0, and 5.1 that initialize an integer*1 array with negative values (that is, -128 to -1), can give incorrect results when run under MS-DOS or OS/2.
RESOLUTIONAdding an executable statement that uses an element of the array within the DO-LOOP, or disabling loop optimization with /Od, /Odct, or /4Yb when compiling, can prevent the problem from occurring.
STATUSMicrosoft 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.
MORE INFORMATIONThe following program examples illustrate the problem:
write(*,*) arr(1) write(*,*) arr(2) end
integer*1 arr(2) arr = -1 write(*,*) arr(1) write(*,*) arr(2) end The programs above produce the following output:
-1 -2The following output should be produced:
-1 -1To prevent the problem from occurring, add an executable statement that uses an element of the array within the DO-LOOP, or disable loop optimization with /Od, /Odct, or /4Yb when compiling.
|
Additional reference words: 5.00 5.10
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |