Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Beginner
3 Views

Compiler bug

This was brought to my attention by a colleague. This code produces a randomly truncated output - and we think that the compiler should detect the interface inconsistency for S.

MODULE M
INTERFACE
    MODULE SUBROUTINE S(C)
    IMPLICIT NONE
    CHARACTER(LEN=:),ALLOCATABLE,INTENT(IN) :: C
    END SUBROUTINE S
END INTERFACE    
END MODULE M

SUBMODULE (M) SM
CONTAINS
    MODULE SUBROUTINE S(C)
    IMPLICIT NONE
    CHARACTER(LEN=*),ALLOCATABLE,INTENT(IN) :: C
    WRITE(*,*) C
    END SUBROUTINE S
END SUBMODULE SM

PROGRAM P
USE M
IMPLICIT NONE
CHARACTER(LEN=:),ALLOCATABLE :: STRING
STRING = 'Ha ha!'
CALL S(STRING)
END PROGRAM P

 

0 Kudos
2 Replies
Highlighted
Black Belt
3 Views

I agree - this is an error

I agree - this is an error the compiler should catch. Please submit it to the Intel Online Service Center.

Steve (aka "Doctor Fortran") - https://stevelionel.com/drfortran
0 Kudos
Highlighted
Beginner
3 Views

Thanks - I did open a support

Thanks - I did open a support ticket.

0 Kudos