- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Why does
...
integer(4) ip
pointer (p,ip)
...
(no further reference to the pointee, ip)
...
cause the compiler to warn that the pointee is never used? Superficially it looks like it is 'used'.
TIA,
Gerry T.
...
integer(4) ip
pointer (p,ip)
...
(no further reference to the pointee, ip)
...
cause the compiler to warn that the pointee is never used? Superficially it looks like it is 'used'.
TIA,
Gerry T.
Link Copied
4 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
How does it look like it is used? It doesn't to me.
Steve
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It superficially looks to be 'used' in the sense that it's the designated pointee of the pointer. How can it be used if only to get rid of the warning?
Thanks,
Gerry T.
Thanks,
Gerry T.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
That's a declaration, not a use. If you have a reference to it in the executable section, that's a use. You might be also able to turn off the diagnostic by naming the pointee in a VOLATILE statement, though I didn't try this.
Steve
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Indeed. Volatile didn't eliminate the warning but using the pointee in the executable statement
pointee=pointee
does. Not a profound issue but one that always had me puzzled.
Ciao,
Gerry T.
pointee=pointee
does. Not a profound issue but one that always had me puzzled.
Ciao,
Gerry T.
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