Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
29280 Discussions

Error: POINTER/POINTEE symbols have different visibility attributes

Jugoslav_Dujic
Valued Contributor II
1,362 Views
IVF 8 will refuse to compile code like following:
Code:
MODULE Foo

PRIVATE

PUBLIC Whatever

INTERFACE
   SUBROUTINE Whatever()
   END SUBROUTINE Whatever
END INTERFACE
POINTER(p_Whatever, Whatever)

END MODULE
Complaining that "Error: POINTER/POINTEE symbols have different visibility attributes". This restriction appears to be new in IVF8, as CVF does not have problems with it.
I don't see a rationale behind this restriction. It looks quite reasonable e.g. tomade only Whatever public and perform the association in a module itself, hiding theassociation details from the outer world. Is there some deeper reason for introduction of that restriction that I don't see?
Jugoslav
0 Kudos
10 Replies
Steven_L_Intel1
Employee
1,362 Views
Jugoslav,
You are correct to say that CVF has no problem with the code you posted. Now try to USE that module. For example:
Code:
MODULE Foo

PRIVATE

PUBLIC Whatever

INTERFACE
   SUBROUTINE Whatever()
   END SUBROUTINE Whatever
END INTERFACE
POINTER(p_Whatever, Whatever)

END MODULE

program main
use foo

call whatever
end
What does CVF think of that? (I can tell you, and the answer is not pretty.)
Yes, we made a change to require that pointer and pointee accessibilities match. It seemed the most consistent approach - a reference to one is implicitly a reference to the other. Prior to this change, attempting to do this would result in an internal compiler error in ifort - just like CVF...
0 Kudos
djip
Beginner
1,362 Views

call whatever

Well.... it is an access on a uninitialized pointer... the crash is normal, and not related with private or public access.

Let correct it: this work whith CVF!

Code:
MODULE Foo
  PRIVATE
  PUBLIC Whatever
  PUBLIC Init

  INTERFACE
    SUBROUTINE Whatever()
    END SUBROUTINE Whatever
  END INTERFACE
  POINTER(p_Whatever, Whatever)
CONTAINS 
  subroutine Whatever_2
    WRITE(*,*) "TOTO"
  end subroutine

  subroutine Init
    p_Whatever = %LOC(Whatever_2);
  end subroutine
END MODULE

program main
  use foo
  call init
  call whatever
end
Here is the bug!
Djip
0 Kudos
Steven_L_Intel1
Employee
1,362 Views
The CVF 6.6C compiler failed with an internal compiler error with my source. No need to run it...
0 Kudos
djip
Beginner
1,362 Views
With your source:
CVF 6.1A compile... and crash an exec... (So I suppose it was the same with 6.6C... bad read your post)
So still my source that Compile and work with 6.1A
What hapend with CVF6.6C and IVF8
All this is to access on a C fonction where the adress is only know at runtime... (In my case the EXTor V1.X (X>1)fonctions of OpenGL that we get with wglGetProcAddress()).
Djip
0 Kudos
Steven_L_Intel1
Employee
1,362 Views
I didn't try CVF 6.1A. That is five years old.
Procedure pointers work fine with both compilers. The particular issue here was with different PUBLIC/PRIVATE visibility on the pointer and pointee, not something most people would try. In fact, the original case of this error we saw didn't use procedure pointers at all.

Message Edited by sblionel on 07-07-2004 06:02 PM

0 Kudos
djip
Beginner
1,362 Views
Sorry I did fortran for hoby and don't have much money to get a more ressante one...
And CVF6.1A have a bug (?) I can't add a
PUBLIC p_Whatever
it resultean error at compile time...
More I nead to have procedure that are Private and some that are Public, that both are pointers procedures.... so the only possibility is to use a generale PRIVATE (or PUBLIC)attribute so the pointer are all private (or public), and define the procedure public or private as needed.
No problme with CVF doing that....
But IVFComplaining that "Error: POINTER/POINTEE symbols have different visibility attributes"
... Well don't now what to do if want to have the same sources for all 3 compilateurs! (and realy dislike to have PUBLIC attribute on pointer...)
Juste to know... is there a raison for require that POINTER/POINTEE have the same attribute!
Djip
0 Kudos
Steven_L_Intel1
Employee
1,362 Views
The reason is that the compiler gets very confused by the different accessibility, and it seemed the right thing to do. You will have to give the pointer and pointee the same visibility attribute.
0 Kudos
Jugoslav_Dujic
Valued Contributor II
1,362 Views
OK, that explains it pretty much (I wasassisting Djipon the F95gl project, so that's we were both interested).
Ona completely unrelated topic, what happened with "E-mail me if someone replies to..." Forum feature? Gosh, can anything be added without screwing something else ? (I know by my own codes that it's rarely the case, but still...)
Jugoslav
0 Kudos
Steven_L_Intel1
Employee
1,362 Views
Grumble... You're right, subscriptions are broken. I'll pass this on.
0 Kudos
Steven_L_Intel1
Employee
1,362 Views
Subscriptions should now be fixed. Let me know if they're not.
0 Kudos
Reply