(j3.2006) binding labels and global identifiers

Bill Long longb
Sun Jun 19 07:22:04 EDT 2011



On 6/19/11 2:36 AM, mickistjames at gmail.com wrote:
> Robert Corbett wrote:
>
>  >Is the program presented above intended to be standard-
>  >conforming?
>
> I would agree with Malcolm and answer no.
>

While one might imagine some scheme to allow the case in the original 
example to work (since global variables and procedures are different 
sorts of objects), the even worse example of an interface block for a 
function with a binding label of subr_ and a function named subr seems 
intractable in an environment where the Fortran processor appends an 
underscore to the end of a procedure name.   The irony is that the 
convention of adding an underscore was designed to prevent (accidental) 
interoperability.


> R303 says that underscores may be used as a significant
> character in a name, but I see no provision for low lines,
> so if "_" in a binding label is a low line then the functionality
> to bind to C names with underscores is simply missing.
>
> Okay, that may have been a joke, but
> "subr_" is not a name in the line
> REAL, BIND(C, NAME="subr_") :: x = 0.1

Right, it is a "binding label".

> it is a scalar-char-initialization-expr or some such, so
> an implementation that wants to outlaw scalar-char-initialization-expr's
> that mimic linker-constructed names with low lines would seem
> to be on narrow but reasonable ground. Is there any expectation that
> absolutely
> any initialization expr is legal?

No. The string has to be legal as a name of the corresponding object in C.

Cheers,
Bill

> Seems like control characters
> are legal in initialization expr's but not in names, if so that would
> already be a special case to handle.
>
> Micki

-- 
Bill Long                                           longb at cray.com
Fortran Technical Support    &                 voice: 651-605-9024
Bioinformatics Software Development            fax:   651-605-9142
Cray Inc./Cray Plaza, Suite 210/380 Jackson St./St. Paul, MN 55101





More information about the J3 mailing list