- Marcar como nuevo
- Favorito
- Suscribir
- Silenciar
- Suscribirse a un feed RSS
- Resaltar
- Imprimir
- Informe de contenido inapropiado
Hello,
I have a question regarding the interface of the final subroutines. According to the Fortran 2003 standards, you can have multiple final bindings, with the following restriction: any two final subroutines for a type must differ in the rank of kind type paramters of the dummy argument. The same final subroutine may not be specified twice.
In the attached small fortran file, I have created an type:
TYPEDerivedQuantityType INTEGER,DIMENSION(:),POINTER::Unit=>null() CONTAINS FINAL::FreeDerivedQuantity FINAL::FreeDerivedQuantities
...
ENDTYPEDerivedQuantityType
Where the interface only differs in rank:
- FreeDerivedQuantities(:)
- FreeDerivedQuantity
This type is part of another type:
TYPEQuantityType TYPE(DerivedQuantityType),DIMENSION(:),POINTER::DerivedQuantity=>null()
CONTAINS
...
ENDTYPEQuantityTypeI use the generic assignment (=) for the derived type (see also the attached file),
NewQuantityType%DerivedQuantity(1)=OldQuantityType%DerivedQuantity(1) The generic assignment has an intent(out) attribute on the DerivedQuantity. The compiler then will deallocate the header argument when the routine is called.
I would have assumed that it is calling the FreeDerivedQuantity routine. However, when I debug the session, I notice that it does use the FreeDerivedQuantities routine, resulting in an access violation.
Does anyone has an explanation for this behavior?
Kind Regards,
Dirk van Meeuwen
- Etiquetas:
- Intel® Fortran Compiler
Enlace copiado
- Marcar como nuevo
- Favorito
- Suscribir
- Silenciar
- Suscribirse a un feed RSS
- Resaltar
- Imprimir
- Informe de contenido inapropiado
- Marcar como nuevo
- Favorito
- Suscribir
- Silenciar
- Suscribirse a un feed RSS
- Resaltar
- Imprimir
- Informe de contenido inapropiado
- Marcar como nuevo
- Favorito
- Suscribir
- Silenciar
- Suscribirse a un feed RSS
- Resaltar
- Imprimir
- Informe de contenido inapropiado
This has been fixed for a release later this year.
- 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