COMMON requires 4 bytes of padding at start

Tobias Burnus burnus@net-b.de
Fri Sep 12 14:56:00 GMT 2008


Tobias Schlüter wrote:
> there are platforms where the padding is required, as unaligned
> accesses to, say, real*8 are forbidden.  I believe Sparc is one of
> them.  On such platforms this can't be made the default.
Do you know where how to check for this in gcc/fortran/*.c?

> In general, I think we should strive for compatibility with g77 by
> default.  People have been using C structures to interoperate with
> COMMONs for a long while, we should try not to break their code.

Well, the problem is: There Fortran codes which get broken by aligning
the data and there codes (like those which use C structs) which get
broken by unaligned memory. By the way, in C one can use
"__attribute__((__packed__))" if one wants to have packed, not aligned
memory.

Thus I'm favor of having such an option, whether it should be on or off
by default is another question (I don't mind either).

Tobias

PS: The struct comptibilty issue one can also mention in invoke.texi.



More information about the Fortran mailing list