$> cat warning.f90
MODULE m
TYPE :: t1
INTEGER :: a = 1 ! component with default initializer first
INTEGER :: b
END TYPE
TYPE :: t2
INTEGER :: a ! component without default initializer first
INTEGER :: b = 2
END TYPE
CONTAINS
SUBROUTINE sub1(x)
type(t1), intent(out) :: x ! no warning
END SUBROUTINE
SUBROUTINE sub2(x)
type(t2), intent(out) :: x ! warning
END SUBROUTINE
END MODULE
$> $ gfortran-svn -Wall -c warning.f90
warning.f90:17.19:
SUBROUTINE sub2(x)
1
Warning: Dummy argument 'x' at (1) was declared INTENT(OUT) but was not set
$> gfortran-svn -v
gcc version 4.5.0 20091212 (experimental) (GCC)
As both types have components without default initializers, I'd expect a
warning in both cases.
--
Summary: intent(out)-dummy-not-set warning for types depends on
order of component initializers
Product: gcc
Version: 4.5.0
Status: UNCONFIRMED
Keywords: diagnostic
Severity: normal
Priority: P3
Component: fortran
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: dfranke at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42360