[J3] Binding labels whose names compare the same when case is ignored
Steve Lionel
steve at stevelionel.com
Fri Feb 21 17:06:02 UTC 2025
18.10.2p2 The case of letters in the binding label is significant.
Steve
On Fri, Feb 21, 2025 at 8:43 AM Thomas König via J3 <
j3 at mailman.j3-fortran.org> wrote:
> I have another question on binding labels. Is the following program
>
> subroutine lower () bind(c,name="foo")
> end subroutine lower
>
> subroutine upper () bind(c,name="FOO")
> end subroutine upper
>
> program memain
> interface
> subroutine lower () bind(c,name="foo")
> end subroutine lower
>
> subroutine upper () bind(c,name="FOO")
> end subroutine upper
> end interface
>
> call lower
> call upper
> end program memain
>
> conforming or not? 19.2 states
>
> A binding label of an entity of the program is a global identifier.
>
> and further down
>
> The global identifier of an entity shall not be the same as the global
> identifier of any other entity. Furthermore, a binding label shall not
> be the same as the global identifier of any other global entity,
> ignoring differences in case.
>
> "foo" and "FOO" are global identifiers of their respective procedures,
> and they are the same if differences in case are ignored.
>
> Therefore, my conclusion would be that this is not conforming.
>
> If that is the case, I would question if this was intentional, because
> that would restrict access to C entities with different cases like
> "foo" and "FOO" above.
>
> Best regards
>
> Thomas
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.j3-fortran.org/pipermail/j3/attachments/20250221/bf8568e3/attachment.htm>
More information about the J3
mailing list