- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Amusing - I would have thought we'd find that one years ago. I'll report it - thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Fixed for a future release (not 11.1).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Fixed in version 12

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page