BUG: Array Expression with Assumed Size Arrays

Last reviewed: December 10, 1995
Article ID: Q106727
The information in this article applies to:
  • Microsoft FORTRAN for MS-DOS, versions 5.0 and 5.1
  • Microsoft FORTRAN for OS/2, versions 5.0 and 5.1
  • Microsoft FORTRAN PowerStation for MS-DOS versions 1.0 and 1.0a
  • Microsoft FORTRAN PowerStation 32 version 1.0 and 4.0

SYMPTOMS

The compiler does not generate an error message when assumed size arrays and scalars are used in an array expression. The array expression does not perform any action.

In FORTRAN PowerStation 32, version 1.0, compiling the sample code below generates:

   Command line error D2030 : INTERNAL COMPILER ERROR in
   'C:\LANG\FPSNT\BIN\f13232.exe'
      Please see the Microsoft Support Services section in the manual for
       more information

For Fortran PowerStation 4.0 the error message given for referenced assumed-size arrays is:

   error FOR2305: invalid appearance of assumed-size array name S

RESOLUTION

Do not use assumed size arrays in an array expression.

STATUS

Microsoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.

MORE INFORMATION

The Microsoft FORTRAN PowerStation "Language Guide" states that arrays in an array expression must "conform", and that one of the requirements for conforming is that the dimensions of the array be known at compile time. The dimensions are not known at compile time for assumed size arrays. Therefore, they are not conforming and must not be used in array expressions.

NOTE: If the array is declared as adjustable, an appropriate error message is generated:

   error F2650: S : array expression : cannot be adjustable-size array

NOTE: If the array expression contains both a fully specified array and assumed size array, the correct error message is generated:

   error F2651: S : array expression : argument does not conform

Sample Code

Compile options: none

      INTEGER*4 FUNCTION SP(s,n)
      INTEGER*4 n, s(*)
c INTEGER*4 n, s(n) !Adjustable size declaration
c      INTEGER*4 t(2)    !Fully specified array
      s = n
c      t = s             !Fully specified array and assumed size array
      SP = s(1)
      END

      integer sp, s(2)
      n = 2
      s = 1
      i = SP(s,n)
      print *, i, s
      end


Additional reference words: 1.00 4.00 5.00 5.10
KBCategory: kbtool kbbuglist kberrmsg
KBSubcategory: FLIss


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: December 10, 1995
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.