- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
I upgraded the IVF Compiler to 17.0.5.267 and now one of my projects won't compile. I get the following error: "Error: A dummy procedure must not be specified with a NAME=Specifier".
My code is doing using the BIND (c) clause just like this: SUBROUTINE CSub () BIND(C, NAME="CSub)
Is there a new way of doing this in this compiler version? Sorry if the question doesn't make much sense. I am fairly new to Fortran :)!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It seems to me that this is likely due to an interface body declaring a dummy subroutine Csub. A nicer way to declare it, if possible, would be to USE the module containing CSub and declare the corresponding dummy argument via the PROCEDURE statement
USE M, only: CSub_paradigm => CSub implicit none procedure(CSub_paradigm) CSub
If this is not feasible, just delete the NAME= clause from the interface body that declares dummy argument CSub.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Well your example shown has an error as you have "csub not "csub" maybe that is a typing error. It is much better to cut an paste some real and more complete code in a fortran box using the {code } tool like below. It will be easier to help then.
subroutine fred() implicit none print *, 'hello world' end subroutine fred
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It seems to me that this is likely due to an interface body declaring a dummy subroutine Csub. A nicer way to declare it, if possible, would be to USE the module containing CSub and declare the corresponding dummy argument via the PROCEDURE statement
USE M, only: CSub_paradigm => CSub implicit none procedure(CSub_paradigm) CSub
If this is not feasible, just delete the NAME= clause from the interface body that declares dummy argument CSub.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes it seems that this error is due to the interface body declaring a dummy subroutine. I am guessing this was allowed in older versions of the compiler?
SUBROUTINE SETCALLBACKFUNC(TESTFUNC) BIND(C,NAME="SETCALLBACKFUNC") IMPLICIT NONE INTERFACE INTEGER FUNCTION TESTFUNC (arg, arg2) BIND(C,NAME="TESTFUNC") IMPLICIT NONE INTEGER :: arg CHARACTER, DIMENSION(*) :: arg2 END FUNCTION TESTFUNC END INTERFACE END SUBROUTINE SETCALLBACKFUNC
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You surely wouldn't want the name= on the interface as you would expect the interface to be generic? Maybe (untested) you mean something like...
subroutine action( sub, a, b) bind(C, name='fred') implicit none integer, intent(in) :: a, b procedure(sub_example) :: sub abstract interface subroutine sub_example(aa, bb) bind(c) integer,intent(in) :: aa, bb end subroutine end interface call sub(a,b) end subroutine action
Which is a variation on what RO suggested.
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page