BUG: Array Expression with Assumed Size Arrays

ID: Q106727

1.00 1.00a | 1.00 4.00

MS-DOS     | WINDOWS NT

The information in this article applies to:

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: KBSubcategory: FLIss
Keywords          : kberrmsg kbLangFortran 
Version           : 1.00 1.00a | 1.00 4.00
Platform          : MS-DOS NT WINDOWS

Last Reviewed: May 23, 1998