- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
Link Copied
10 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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:
What does CVF think of that? (I can tell you, and the answer is not pretty.)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
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...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The CVF 6.6C compiler failed with an internal compiler error with my source. No need to run it...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Grumble... You're right, subscriptions are broken. I'll pass this on.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Subscriptions should now be fixed. Let me know if they're not.

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