Silverfrost Forums

Welcome to our forums

Generic interfaces and /CHECKMATE

4 Mar 2013 4:47 #11650

This program crashes when run with /CHECKMATE because c is thought to be undeclared, which is true but presumably irrelevant. The program works if c is one-dimensional or does not have a lower limit of 0. It also works if there is no interface (e.g., if s2 is called directly).

WINAPP
MODULE m
  INTERFACE s
   MODULE PROCEDURE s1
   MODULE PROCEDURE s2
  END INTERFACE s
CONTAINS
 SUBROUTINE s1 (c)
  CHARACTER(LEN=*), DIMENSION(:), INTENT(OUT) :: c
  c(:)='A'
 END SUBROUTINE s1
 SUBROUTINE s2 (c)
  CHARACTER(LEN=*), DIMENSION(:,:), INTENT(OUT) :: c
  c(:,:)='A'
 END SUBROUTINE s2
END MODULE m
PROGRAM p
 USE m, ONLY: s
 CHARACTER(LEN=1), DIMENSION(0:2,2) :: c
 CALL s (c(0:,:))
END PROGRAM p
4 Mar 2013 1:40 #11653

Thanks. I have logged this for investigation.

To avoid the false run time error report, use /UNDEF instead of /CHECKMATE.

6 Apr 2013 3:57 #11984

This bug has been fixed for the next release.

Please login to reply.