I think gfortran is correct in this case. It is ambiguous what the length of the characters in the array should be without either the explicit type declaration in the constructor (@Beliavsky’s example), or each being the same length. Intel is doing the nice thing here and assuming the length of the longest one, but the standard doesn’t say that is what should happen, and in fact there are cases where you wouldn’t necessarily be able to tell at compile time what the length of each would be. I.e.
num_strings = [to_string(x), to_sting(y), to_string(z)]
where
function to_string(a) result(string)
integer, intent(in) :: a
character(len=:), allocatable :: string
...
end function