Warning with integer pointers

Warning with integer pointers

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.

5 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

How does it look like it is used? It doesn't to me.

Steve

Steve - Intel Developer Support

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.

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 - Intel Developer Support

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.

Leave a Comment

Please sign in to add a comment. Not a member? Join today