- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
There is a weird error if you wrap an intrinsic function, then rename the wrapper in a use statement to have the same name as the original intrinsic. This is usually something that you would only do if you wanted to choose between your own implementation of a function and the compiler's. See here:
module wrap_gamma implicit none contains real function wrapper(x) real, intent(in) :: x wrapper = gamma(x) end function wrapper end module wrap_gamma program test_intrinsic_name_reuse use wrap_gamma, only: gamma => wrapper implicit none print *, gamma(2._r8) end program test_intrinsic_name_reuse
I found that this only happens if you actually use the intrinsic in the wrapper (e.g. no error if you remove the "wrapper = gamma(x)" line), and the issue also goes away if you use a generic function to create another alias (e.g. creating a "wrapper2" generic function and then aliasing gamma to that in the main program above). That second case is the workaround that I've been using.
- Balises:
- Intel® Fortran Compiler
Lien copié
- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
Thanks - I have escalated this as issue DPD200361667.
- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
I just noticed that I made a copy/paste error in the OP; the argument to "gamma" was supposed to be "2.0". However, this is irrelevant in that you get the same internal compiler error either way.
- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
This is fixed for a release later this year.

- S'abonner au fil RSS
- Marquer le sujet comme nouveau
- Marquer le sujet comme lu
- Placer ce Sujet en tête de liste pour l'utilisateur actuel
- Marquer
- S'abonner
- Page imprimable