- Marcar como nuevo
- Favorito
- Suscribir
- Silenciar
- Suscribirse a un feed RSS
- Resaltar
- Imprimir
- Informe de contenido inapropiado
The following invalid code is erroneously accepted by ifort 2021.4.0:
type :: bad_pdt (k,l)
integer, kind, len :: k = 1
integer, len, kind :: l = 1
character(kind=k,len=l) :: c
end type bad_pdt
end
The Fortran 2018 standard (and similarly 2003+) state:
F2018: 7.5.3.1 Type parameter definition statement R732 type-param-def-stmt is integer-type-spec, type-param-attr-spec :: type-param-decl-list R734 type-param-attr-spec is KIND or LEN (3) The type-param-attr-spec explicitly specifies whether a type parameter is a kind parameter or a length parameter. Thus the KIND and LEN attributes are mutually exclusive.
The correct solution would be to reject the code sample.
Thanks,
Harald
- Marcar como nuevo
- Favorito
- Suscribir
- Silenciar
- Suscribirse a un feed RSS
- Resaltar
- Imprimir
- Informe de contenido inapropiado
I filed a bug report on this issue for you, CMPLRIL0-34368. I'll let you know when a fix is available.
Enlace copiado
- Marcar como nuevo
- Favorito
- Suscribir
- Silenciar
- Suscribirse a un feed RSS
- Resaltar
- Imprimir
- Informe de contenido inapropiado
FWIW your type declaration is (may be) non-conformant. From:
A type declaration has the general form:
- Marcar como nuevo
- Favorito
- Suscribir
- Silenciar
- Suscribirse a un feed RSS
- Resaltar
- Imprimir
- Informe de contenido inapropiado
Jim,
I was talking about F2003 parameterized derived types. I wouldn't call that "old/legacy" yet. Maybe you are thinking of some old/legacy DEC/Intel extension?
The compiler should provide a means to reject non-standard-conforming code. The above sample violates F2018:R734. "ifort -stand" remains quiet.
Harald
- Marcar como nuevo
- Favorito
- Suscribir
- Silenciar
- Suscribirse a un feed RSS
- Resaltar
- Imprimir
- Informe de contenido inapropiado
I agree that the compiler should complain. This is not an extension, just a lack of error checking.
- Marcar como nuevo
- Favorito
- Suscribir
- Silenciar
- Suscribirse a un feed RSS
- Resaltar
- Imprimir
- Informe de contenido inapropiado
I filed a bug report on this issue for you, CMPLRIL0-34368. I'll let you know when a fix is available.
- Marcar como nuevo
- Favorito
- Suscribir
- Silenciar
- Suscribirse a un feed RSS
- Resaltar
- Imprimir
- Informe de contenido inapropiado
With the 2024.1 release both ifx and ifort are printing error messages.
These compilers were made available last week. Please try them!
- Marcar como nuevo
- Favorito
- Suscribir
- Silenciar
- Suscribirse a un feed RSS
- Resaltar
- Imprimir
- Informe de contenido inapropiado
It is indeed diagnosed properly now. Thanks!

- Suscribirse a un feed RSS
- Marcar tema como nuevo
- Marcar tema como leído
- Flotar este Tema para el usuario actual
- Favorito
- Suscribir
- Página de impresión sencilla