Re: Direct access and derived types.
- From: nospam@xxxxxxxxxxxxx (Richard E Maine)
- Date: Tue, 6 Jun 2006 08:51:32 -0700
Joost <jv244@xxxxxxxxx> wrote:
Changing the order of the components can also change things here. Again,
that is not guaranteed by the standard. I would be extremely reluctant
to write code whose correct working depends on the order of the
components. That implies a nonstandard assumption, and one that might
cause the code to break with a new version of the compiler or different
compiler switches.
I assume that the BIND(C) F2003 attribute could help to get a 'kind of
portable' layout of derived types ? Since a few compilers already
support this, this could be an option as well.
Perhaps, but... I'm not sure that C guarantees the layout and padding in
all cases either, probably for the same reason that Fortran doesn't.
After all, the underlying issue is a hardware one, which isn't going to
just go away by switching languages. C, being aimed at a "lower level",
might give you more control of the options than Fortran does, but I'm
not sure that you can do completely arbitrary things with the layout and
expect them to work without padding.
I'm not that much of a C expert, so I could be wrong on all this.
--
Richard Maine | Good judgment comes from experience;
email: my first.last at org.domain| experience comes from bad judgment.
org: nasa, domain: gov | -- Mark Twain
.
- Follow-Ups:
- Re: Direct access and derived types.
- From: glen herrmannsfeldt
- Re: Direct access and derived types.
- References:
- Direct access and derived types.
- From: L. Johansen
- Re: Direct access and derived types.
- From: Richard E Maine
- Re: Direct access and derived types.
- From: Joost
- Direct access and derived types.
- Prev by Date: Re: Direct access and derived types.
- Next by Date: changing a bit of a real
- Previous by thread: Re: Direct access and derived types.
- Next by thread: Re: Direct access and derived types.
- Index(es):
Relevant Pages
|