Problem Description : If a derived type is declared containing a UNION, and the type is a SEQUENCE type or is interoperable (BIND(C)), and the UNION contains a misaligned field, the compiler incorrectly adds padding bytes before each misaligned field.
UNION is an extension to the Fortran standard, supported by Intel Fortran, that allows the declaration of overlapping sets of derived type components. A SEQUENCE type is a derived type containing the SEQUENCE keyword. The Fortran standard specifies that components of a SEQUENCE type may not be rearranged by the compiler; in Intel Fortran, SEQUENCE types do not, by default, have alignment padding added before misaligned components. (This can be overridden with the "align sequence" option.) Lastly, an interoperable derived type, declared with the BIND(C) specifier, is required to have its components laid out exactly as the companion C processor would do it - this may involve padding if the C processor would pad by default.
Consider the following declaration:
type :: mytype
Page viewed 11329 times since Fri 16 Oct 2009, 21:41.