- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The following code fails (Update 1, 2016.0.1.51; both 32 bits and 64 bits.)
MODULE ti_mod USE ISO_C_BINDING IMPLICIT none PRIVATE ! INTEGER,PUBLIC,PARAMETER :: GLintptr = C_INTPTR_T ! PUBLIC :: glBsd POINTER :: glBsd INTERFACE SUBROUTINE glBsd(tg) BIND(C) ! ! The following two lines let the compilation fail: ! IMPORT :: GLintptr INTEGER(KIND=GLintptr),VALUE :: tg ! ! If the preceeding lines are replace by the following ones, everything wents fine. ! ! USE ISO_C_BINDING ! INTEGER(KIND=C_INTPTR_T),VALUE :: tg ! END SUBROUTINE glBsd END INTERFACE ! END MODULE ti_mod
Our gfortran friends do not complain! A compiler bug, I guess?
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks - escalated as DPD200380354. Another way around this is to use an abstract interface, which is how I like to declare procedure pointers. For example:
MODULE ti_mod USE ISO_C_BINDING IMPLICIT none PRIVATE ! INTEGER,PUBLIC,PARAMETER :: GLintptr = C_INTPTR_T ! PUBLIC :: glBsd PROCEDURE(glBsd_Int), POINTER :: glBsd ABSTRACT INTERFACE SUBROUTINE glBsd_Int(tg) BIND(C) IMPORT :: GLintptr INTEGER(KIND=GLintptr),VALUE :: tg END SUBROUTINE glBsd_Int END INTERFACE ! END MODULE ti_mod
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Steve, thanks for the suggestion.

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