Community
cancel
Showing results for 
Search instead for 
Did you mean: 
abhimodak
New Contributor I
38 Views

Bind(C) with multiple variables

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

0 Kudos
1 Reply
FortranFan
Honored Contributor I
32 Views

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"