- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Is there something to specify the name-case for multiple variables using Bind(C)? For example,
Module OM
Use ISO_C_Binding
Implicit None
Integer, Protected, Bind(C) :: iVar = 1, jVar = 2
End Module OM
When the iVar and jVar are picked up on the C-side they will all be lowercase. I believe --to enforce the name case, one can write one line for each variable like
Integer, Protected, Bind(C,Name='iVar') :: iVar = 1
Integer, Protected, Bind(C,Name='jVar') :: jVar = 2
There will be n such lines for n variable. I am wondering if there something (attribute) so that only one line is needed? For example,
Integer, Protected, Bind(C), someAttributeEnforcingTheNameCase :: iVar, jVar
Abhi
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Current Fortran standard (2018) offers no such attribute.
Re: lowercase, you may take note the standard confirms what you believe, "If a variable or common block has the BIND attribute specified without a NAME= specifier, the binding label is the same as the name of the entity using lower case letters"

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page