(j3.2006) binding labels and global identifiers

mickistjames at gmail.com mickistjames
Wed Jun 22 13:19:27 EDT 2011


If the Unix implementations don't mind a very small bit of backwards
incompatibility that affects only backwards compatibility of
certain codes that don't predate Fortran 2003 (and therefore are not
entrenched in the ecosystem), I think there's an easy fix to the
standard.

Simply visit 3.1.1 which says

> A lower-case letter is equivalent to the corresponding upper-case letter  
> in
program units except in a character context (3.3).

and append the text

> A final underscore is equivalent to a blank in a binding label context.

With a stroke this would eliminate the user's ability to distinguish
between C functions "subr" and "subr_". The user hardly ever wants
this privilege and often gets it wrong anyway. It is now user's  
responsibility
to avoid binding label "subr_" if user already has a global identifier with
name subr.

Is it extra work at linking? Just barely. Say FORTRAN wants to interoperate
with a global procedure with binding label "subr_". If the final underscore
is equivalent to a blank, that creates an ambiguity--do you want to link
with subr or with subr_ ? Companion processor will have supplied only
one of these if user is playing fair. Implementation must figure out which  
is
available in a pre-link step, and patch the name. C++ compilers have used
pre-link steps for years so technology may even already be in place.

Micki
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://j3-fortran.org/pipermail/j3/attachments/20110622/da1b8954/attachment.html>



More information about the J3 mailing list