This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
question on bind(c) global vars
- From: "Christopher D. Rickett" <crickett at lanl dot gov>
- To: fortran at gcc dot gnu dot org
- Date: Fri, 12 Jan 2007 18:10:23 -0700 (MST)
- Subject: question on bind(c) global vars
- Reply-to: crickett at lanl dot gov
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