| FIX: ALLOCATABLE on Formal Argument Gives No ErrorLast reviewed: September 16, 1997Article ID: Q86391 | 
| 5.00   | 5.00
MS-DOS | OS/2
kbtool kbbuglist kbfixlist kberrmsg The information in this article applies to: 
 
 SYMPTOMSThe Microsoft FORTRAN 5.0 compiler fails to output an error message when the ALLOCATABLE attribute is placed on a formal argument of a subprogram. The following run-time error is generated when executing this code in either MS-DOS or OS/2: 
 run-time error F6316: ALLOCATE - array already allocatedThe following compiler error should be generated: 
 F2420 : (arrayname) : ALLOCATABLE: dummy argument illegal RESOLUTIONAvoid using the ALLOCATABLE attribute on formal arguments. 
 STATUSMicrosoft has confirmed this to be a problem in Microsoft FORTRAN version 5.0 for MS-DOS and OS/2. This problem was corrected in Microsoft FORTRAN version 5.1. 
 MORE INFORMATIONPage 145 of the "Microsoft FORTRAN Reference" version 5.0 manual states that ALLOCATABLE arrays must not be formal arguments. 
 Sample CodeThe following code reproduces the problem: 
       integer base,size
      call sub1(base,size)
      end
      subroutine sub1(base,size)
      integer base [allocatable] (:)
      integer size
      allocate (base(size))
      return
      end
 | 
| Additional reference words: 5.00 5.10 buglist5.00 fixlist5.10 
 © 1998 Microsoft Corporation. All rights reserved. Terms of Use. |