Fortran, complex types, and STRICT_ALIGNMENT
Steve Kargl
sgk@troutmask.apl.washington.edu
Wed Jan 12 19:27:00 GMT 2005
On Wed, Jan 12, 2005 at 08:26:54AM -0500, James Morrison wrote:
>
> Right now in fortran/iresolve.c it is assumed that complex types can
> be used in places where integers twice the size of an element in the
> complex number can be used.
This sounds odd to me, and may indicate a bug. Can you be
more specific with regards to a location where this
assumption applies?
As far as alignment and padding, the only requirement
in the Fortran standard is that sizeof(REAL) == sizeof(INTEGER)
and sizeof(COMPLEX) == 2 * sizeof(REAL) for the default
kinds. AFAIK, the standard does not mandate anything about the
actual layout in memory. If sizeof(REAL)=4 bytes, then sizeof(COMPLEX)
is 8 bytes, but those do not need to be 8 consecutive bytes in
memory.
--
Steve
More information about the Fortran
mailing list