- Marcar como novo
- Marcador
- Subscrever
- Silenciar
- Subscrever fonte RSS
- Destacar
- Imprimir
- Denunciar conteúdo inapropriado
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.
- Marcas:
- Intel® Fortran Compiler
Link copiado
- Marcar como novo
- Marcador
- Subscrever
- Silenciar
- Subscrever fonte RSS
- Destacar
- Imprimir
- Denunciar conteúdo inapropriado
Thanks - I have escalated this as issue DPD200361667.
- Marcar como novo
- Marcador
- Subscrever
- Silenciar
- Subscrever fonte RSS
- Destacar
- Imprimir
- Denunciar conteúdo inapropriado
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.
- Marcar como novo
- Marcador
- Subscrever
- Silenciar
- Subscrever fonte RSS
- Destacar
- Imprimir
- Denunciar conteúdo inapropriado
This is fixed for a release later this year.

- Subscrever fonte RSS
- Marcar tópico como novo
- Marcar tópico como lido
- Flutuar este Tópico para o utilizador atual
- Marcador
- Subscrever
- Página amigável para impressora