(j3.2006) binding labels and global identifiers
Bill Long
longb
Wed Jun 22 15:41:30 EDT 2011
On 6/22/11 2:23 PM, Van Snyder wrote:
>
> On Wed, 2011-06-22 at 11:30 -0700, Bill Long wrote:
>> I think that special-casing the words for the Unix f77 convention is not
>> the right way to fix this in the standard. It just invites future
>> problems when some other convention is encountered. The goal is to make
>> sure that a single linker symbol is not used as an identifier for two
>> different objects. That goal is what the wording in the standard needs
>> to accomplish. The current text in the standard for this is:
>>
>> "The global identifier of an entity shall not be the same as the global
>> identifier of any other entity."
>>
>>
>> This needs to be munged into something like
>>
>> "A global identifier that identifies an entity shall not be the same as
>> a global identifier that identifies any other entity."
>>
>> Data subgroup can probably do a better job of wordsmithing this, but I
>> think this is the general direction for a solution.
>
> This isn't enough. Clause 16 specifies what the global identifier of a
> global entity is. If a global entity is to have additional global
> identifiers, other than its Fortran identifier and its binding label,
> the standard needs to say so.
>
I readily admit that the wording needs work. But the idea is that if a
particular identifier identifies object A and another identifier also
identifies object A, then the second one cannot be used to identify
object B if A and B are different.
> Then it should continue "There is no way, be examining the standard, to
> determine all the global identifiers of a global entity."
>
If we stick with the current definition of global identifier, then it is
the case that "A global entity may have more than one global identifier."
> Then stuff in Annex A specifying that the relationship of the global
> identifiers of a global entity to the Fortran identifier of the entity
> is processor dependent.
>
> Then a recommendation that easily-found documentation accompanying
> processors explains their name mangling schemes.
>
> Thereby, all one needs do in order to write a portable program is to get
> documentation from all known processor vendors and find their scheme for
> name mangling. Simple, right?
>
Craig and Jim have pointed out examples of operating systems that do not
have this problem. Before we switched to Unix, the Cray OS also did not
have the problem. It might be only Unix variants. Unfortunately that
covers a wide swath. One could argue (and expect a lot of counter
argument) that the Unix rule applies to "f77" and later Fortran
compilers are not covered, so could use a different rule.
In any case, this is a candidate for an Interp.
Cheers,
Bill
--
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