This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/41227] COMMON block, BIND(C) and LTO interoperability issues
- From: "fxcoudert at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 14 Jul 2014 13:07:06 +0000
- Subject: [Bug fortran/41227] COMMON block, BIND(C) and LTO interoperability issues
- Auto-submitted: auto-generated
- References: <bug-41227-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=41227
--- Comment #21 from Francois-Xavier Coudert <fxcoudert at gcc dot gnu.org> ---
(In reply to Tobias Burnus from comment #18)
> By your argument,
> int i;
> and
> struct { int i; } a;
> are interoperable.
No. The standard only defines interoperability as a one-to-one mapping between
one Fortran entity and one C entity.
An "extern int i" and "integer(int_c) :: i" are interoperable. By the standard,
a common block with i as single variable is interoperable with "extern struct {
int i; } a;" or "int i;" (where the question is whether "or" is exclusive or
not).
But I don't see how you can expand that to mean that the common block is
interoperable with "struct { struct { int i; } a; } a;" by a simple reading of
the standard. There are, in my reading, 2 or 3 (with the same "or" as before)
entities interoperable with this nested struct:
- a derived type containing a derived type containing "integer(int_c) :: i"
- a common containing the dt containing the dt
- a common containing a derived type containing "integer(int_c) :: i"
> Otherwise, I stand to what I wrote before: I think the standard does not
> demand the interoperability.
Let's raise a formal interp, then.