Рассмотрим следующий код:
subroutine tao_show_this ()
implicit none
type b_struct
integer, pointer :: good_user => null()
end type
type a_struct
type (b_struct), allocatable :: value_ptr(:)
end type
type (a_struct) a
a = a_struct()
end subroutine
Компиляция с gfortran 5 или 7 дает:
gfortran -c test.f90
test.f90:4:13:
type b_struct
1
Error: The rank of the element in the structure constructor at (1) does not match that of the component (0/1)
Этот код прекрасно компилируется с ifort.Это ошибка gfortran или что-то не так с моим кодом?