FIX: F1001 ctypes.c:1.21, Line 1655: ISHFTLast reviewed: September 16, 1997Article ID: Q87981 |
4.00 4.01 4.10 5.00 5.10 | 4.10 5.00 5.10
MS-DOS | OS/2kbtool kbfixlist kbbuglist kberrmsg kbcode The information in this article applies to:
SYMPTOMSUsing Microsoft FORTRAN compiler version 4.0, 4.01, 4.1, 5.0, or 5.1 under MS-DOS or version 4.1, 5.0, 5.1 under OS/2 to compile code that contains the intrinsic function ISHFT in a calculation that results in the smallest representable negative integer may cause the compiler to hang the machine under MS-DOS or to generate SYS1942 error TRAP 000C under OS/2. Using the compiler options /Zi or /Od (both at the same time or separately) may cause the following errors to be generated:
CAUSEBecause the expression involves constants and not variables, the compiler attempts to calculate the expression at compile time. The compiler is incorrectly dealing with the special case of the smallest representable integer value. An internal compiler overflow results in the errors.
RESOLUTIONAssign the value of the constants to variables and use variables in the expression.
STATUSMicrosoft has confirmed this to be a problem in FORTRAN versions 4.0, 4.01, 4.1, 5.0 and 5.1. We are researching this problem and will post new information here as it becomes available.
MORE INFORMATIONThe following code can be used to reproduce the problem:
Sample Code #1
integer*4 ivar1 ivar1=ISHFT(1,31)+1 ! ISHFT(1,31)=-2147483648 causes ! compiler overflow error stop endThe following code demonstrates a solution:
Sample Code #2
integer*4 ivar1, ivar2, ivar3 ivar2=1 ivar3=31 ivar1=ISHFT(ivar2,ivar3)+1 stop end |
Additional reference words: 4.00 4.10 5.00 5.10
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |