This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

question on bind(c) global vars


i'm working on the bugs listed on the wiki for iso_c_binding, and i have a
question on this one:

"Bind(C) variables are only allowed in modules specification, gfortran
accepts them also in the program part. "15.3 Interoperation with C global
variables -- A C variable with external linkage may interoperate with a
common block or with a variable declared in the scope of a module. The
common block or variable shall be specified to have the BIND attribute.""

does this apply to subroutines and functions also?  right now, i allow a
separate source file to have subroutine decls that can be bind(c).  do
these have to be contained within a module in order to be bind(c).  just
fyi, i intentionally allowed bind(c) on routines that were not declared
within a module, but i thought i was enforcing variables to be declared
within a module or be a common block.  i know i check that dummys are not
declared bind(c), but i apparently am missing the check on normal
variables.

thanks.
Chris



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]