Re: Warning: The structure contains misaligned fields



jamesgiles@xxxxxxx wrote:
On Apr 28, 11:35 am, Craig Powers <eni...@xxxxxxxxxx> wrote:

The significance of SEQUENCE is that identically-declared types will be
treated as identical (i.e. if you were to repeat your declaration of
type(ccc) in a subroutine, it would be identical to the type(ccc)
declared in the module and one could be used as an actual argument
corresponding to the other as a dummy argument). The name implies that
the memory layout will be exactly as declared, but the standard does not
actually impose such a requirement.

It doesn't usually say anything about memory layout as such. However,
since SEQUENCE derived types may be used in COMMON and the components
be storage associated through that COMMON with non-derived-type
variables, it's hard to imagine how it would be implemented without
actually being in the order declared.

I thought that padding was allowed, though. COMMON in Fortran 66
was usually believed not to allow padding, creating alignment
problems fairly often. C struct definitely allows padding, which
is good because many current processors don't allow misaligned
access. (IA32 does, but it is often much slower.)
Doesn't COMMON now allow for padding?

If SEQUENCE types work with C interoperability they better
use the same padding that is used by the appropriate C compiler.

-- glen

.



Relevant Pages

  • Re: Why does IE add a pixel of white space around my links?
    ... up PADDING shortcut so it becomes PADDING-LEFT, PADDING-TOP etc., the ... MARGIN shortcut is not rolled up. ... declaration, but it stays the same for any ...
    (comp.infosystems.www.authoring.stylesheets)
  • Re: positioning & padding in DIV elements ...
    ... workaround/solution is to remove the width declaration from ... box padding totally disapper; I then added the padding to the outer box ... tried removing the width declaration from the bottom nav, ...
    (alt.html)
  • Re: positioning & padding in DIV elements ...
    ... workaround/solution is to remove the width declaration from ... box padding totally disapper; I then added the padding to the outer box ... intro and bkg pages), but on the other site pages, the header graphic is now ...
    (alt.html)
  • Re: Common programming mistakes?
    ... I think of some kind of list that states the most common ... programming errors together with their frequency and the cost to find ... a declaration hides another declaration ... uninitialized memory (eg: using malloc and forgetting to use memset or such ...
    (comp.lang.misc)
  • Re: Return value of _time64() in VS2005
    ... >The common description of timeand _time64() says that the function ... >declaration above. ... referring to times between 1903 and 1970. ...
    (microsoft.public.vc.language)