Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

Warning with integer pointers

gfthomas8
Novice
2,134 Views
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.
0 Kudos
4 Replies
Steven_L_Intel1
Employee
2,134 Views
How does it look like it is used? It doesn't to me.

Steve
0 Kudos
gfthomas8
Novice
2,134 Views
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.
0 Kudos
Steven_L_Intel1
Employee
2,134 Views
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
0 Kudos
gfthomas8
Novice
2,134 Views
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.
0 Kudos
Reply