Silverfrost Forums

Welcome to our forums

Allocating an array incorrectly

26 Sep 2011 6:08 #9025

The following program assigns an array, but with too few dimensions. The program prints a 1 and then some nonsense number depending upon the compiler options. (If the array is declared in a module and compiled using only /LGO, the program will print two 1s.) It would be helpful if the compiler could pick this up as a programming error, which I assume it is.

PROGRAM p
  INTEGER, ALLOCATABLE :: i(:,:)
  ALLOCATE (i(1))
  PRINT*, SHAPE(i)
END PROGRAM p
27 Sep 2011 6:08 #9026

I have logged this for investigation.

23 Feb 2012 2:27 #9675

I have fixed this omission for the next release of FTN95.

Please login to reply.