gfortran does not correctly check that an intent(out) dummy argument does not appear in a specification statement. The following code is invalid, yet gfortan compiles it without error.
subroutine sub(n, s) integer, intent(out) :: n character(len=*), intent(out) :: s character(len=len(s)) :: a ! Valid even though s is intent(out) character(len=len(s(1:n))) :: b ! Invalid because n is intent(out) n = 0 a = 'tobias' s = a b = a end subroutine See the discussion in http://gcc.gnu.org/ml/fortran/2010-09/msg00074.html for more details. -- Summary: intent(out) dummy arguements in specification statements Product: gcc Version: 4.6.0 Status: UNCONFIRMED Keywords: accepts-invalid Severity: normal Priority: P3 Component: fortran AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: kargl at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45619