- Marcar como novo
- Marcador
- Subscrever
- Silenciar
- Subscrever fonte RSS
- Destacar
- Imprimir
- Denunciar conteúdo inapropriado
The compiler's (v11.0.074, VS2008) criteria for "used" variables seem to include only that a variable appear in a statement with an equals sign, or as an argument to a function or subroutine, or as an array index. Specifically, a variable specified to be a pointer but not otherwise directly referenced is flagged as "unused". Consider the following:
remark #7712: This variable has not been used. [LOCDIS].
This is not a show-stopper, but nonetheless mildly annoying. Is this problem fixable, or worth fixing?
TIA
[cpp] SUBROUTINE DrawColorSwatch (locDIS, color) IMPLICIT NONE INTEGER, INTENT(IN) :: locDIS INTEGER, INTENT(IN) :: color INTEGER :: rval TYPE(T_RECT) :: clientRect TYPE(T_DRAWITEMSTRUCT) :: dis POINTER(locDIS, dis) ! dummy assignment to fool the compiler's unused-variables checker rval = locDIS rval = GetClientRect (dis%hwndItem, clientRect) CALL fill_rectangle (dis%hDc, color, clientRect) END SUBROUTINE DrawColorSwatch [/cpp]If the rval=locDIS statement is commented out, the compiler produces
remark #7712: This variable has not been used. [LOCDIS].
This is not a show-stopper, but nonetheless mildly annoying. Is this problem fixable, or worth fixing?
TIA
- Marcas:
- Intel® Fortran Compiler
Link copiado
3 Respostas
- Marcar como novo
- Marcador
- Subscrever
- Silenciar
- Subscrever fonte RSS
- Destacar
- Imprimir
- Denunciar conteúdo inapropriado
Amusing - I would have thought we'd find that one years ago. I'll report it - thanks.
- Marcar como novo
- Marcador
- Subscrever
- Silenciar
- Subscrever fonte RSS
- Destacar
- Imprimir
- Denunciar conteúdo inapropriado
Fixed for a future release (not 11.1).
- Marcar como novo
- Marcador
- Subscrever
- Silenciar
- Subscrever fonte RSS
- Destacar
- Imprimir
- Denunciar conteúdo inapropriado
Fixed in version 12

Responder
Opções do tópico
- 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