Microsoft KB Archive/100377
Article ID: 100377
Article Last Modified on 10/17/2003
- Microsoft FORTRAN PowerStation 1.0 Standard Edition
- Microsoft Fortran PowerStation 1.0a for MS-DOS
- Microsoft FORTRAN PowerStation 32
This article was previously published under Q100377
An attempt to compile an application fails and Microsoft FORTRAN PowerStation version 1.0 for MS-DOS displays the following message:
FORTRAN PowerStation version 1.0a for MS-DOS displays the following error message:
The command line specifies the /Ox optimization and the code contains an expression that computes a negative integer power of a constant integer or of an integer expression. The error above occurs when the compiler processes the unary minus operator in an integer exponentiation expression.
There are two methods to work around this problem:
- Modify the compiler command line to specify the /Oxp compiler option switch.
- Modify the source code to remove the unary minus operator from integer expressions used as exponents. Assign the exponent to a temporary variable and negate the value. Then specify the temporary as the exponent.
Microsoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article. This problem was fixed in FORTRAN PowerStation 32, version 4.0.
The following sample code demonstrates this problem:
Sample Code #1
c Compiler options needed: /Ox program test integer j real x j = 1 x = 2**(-j) print *, x end
The following sample code demonstrates one method to work around this problem:
Sample Code #2
c Compile options needed: /Ox program test integer j real x j = 1 j = -j ! Negation occurs here. x = 2**(j) print *, x end
Additional query words: 1.00 1.00a
Keywords: kberrmsg kbbug kbfix kbcompiler KB100377