Re: Warning: The structure contains misaligned fields



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.

--
J. Giles

"I conclude that there are two ways of constructing a software
design: One way is to make it so simple that there are obviously
no deficiencies and the other way is to make it so complicated
that there are no obvious deficiencies." -- C. A. R. Hoare
.



Relevant Pages

  • 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)
  • Re: Common block file
    ... The bulk of the files are auto declared using the i-n option ... In that case you are going to have to keep the common statement inside the module - because it's the only declaration of the variables. ... That doesn't hurt, but it will make it a bit more awkward to make some other modernisations/improvements (such as making some of the arrays allocatable, allowing greater flexibility in the size of problem you can consider) - you can't do that with an array in common, but you can with an array in a module. ...
    (comp.lang.fortran)
  • Re: variable changes value spontaneously
    ... > their type declared in the common statement. ... I claim that the type information is not then in the common statement. ... The typ[e information comes from the implicit statement. ... type declaration statements either), ...
    (comp.lang.fortran)
  • Re: D3, Common, and @variables, any required order??
    ... The general requirement of compilers is that a Common variable cannot be ... than the Main declaration in subs. ... in a subroutine can be anywhere or not at all. ...
    (comp.databases.pick)