MPI Forum Meetings logo

MPI Forum: mpi3-fortran Mailing List Archives

all MPI Forum: mpi3-fortran mailing list

Subject: Re: [MPI3 Fortran] Proposing changes to Fortran 2008
From: Aleksandar Donev (donev1_at_[hidden])
Date: 2008-03-20 12:50:33


Craig Rasmussen wrote:
> struct foo {
> char a;
> char b;
> int i;
> char c;
> char d;
> }
>
> Don't you have to worry about the C compiler reordering the elements
> of foo?
No, the C standard mandates that the order be preserved (with possible
padding). I don't know the C99 standard well-enough to search it
efficiently, but I am pretty sure it is so. Fortran does not guarantee
anything unless it is an interoperable type.
Aleks