Re: Layout in memory

From: David Sagan (dcs256_at_hotmail.com)
Date: 08/02/04


Date: 2 Aug 2004 14:17:30 -0700

pa@see.signature.invalid (Pierre Asselin) wrote in message news:

> You can improve your odds a little by adding "sequence" statements, like this:

Very interesting. Thanks. But this brings up another question: Suppose
I
have a module like:

module this_mod
type this_struct
  ... define the structure without a sequence statement ...
end type
end moule

Now suppose I have a subroutine like:

subroutine sub1 (this_arg)
  use this_mod
  type (this_struct) this_arg
end subroutine

And I have a main program like

program main
  use this_mod
  type (this_struct) an_arg
  call sub1 (an_arg)
end program

Suppose now I compile this_mod and sub1 with Compiler1 and put sub1
in a library which I ship off to a friend along with the source code.
Suppose then that my friend compiles this_mod and main with Compiler2.
 Are you saying my friend cannot safely link them together since the
layout of the structure may not be the same? Even if my friend had the
compiled this_mod module he/she could not necessarily use it since (I
hear) that modules from one compiler may not be accepted by another.

-- David Sagan



Relevant Pages

  • Re: Class templates and friend function templates
    ... likely it's a VC bug that this code compiles. ... Your code can be made to compile on Comeau if you make the friend ...
    (microsoft.public.vc.language)
  • Re: Segmentation Fault
    ... > subroutine, reporting a segmentation fault as it does so. ... > set then it compiles and executes correctly. ... > executes correctly if the -Mbounds flag is set during compilation. ... and then recompile and link the source files one by one without ...
    (comp.lang.fortran)
  • Re: moving from ifort to gfortran
    ... the gfortran manual, the F95 standard or any book on the subject. ... subroutine AssembleConcentratedTransportMatrix & ... compiles with all versions of gfortran that I still have on my system, ... them using Intel Fortran on LINUX. ...
    (comp.lang.fortran)
  • Re: LEN() of unallocated array
    ... > Now, AFAIK, the above subroutine is legal Fortran; ... > end program test ... CVF compiles above ok, but has a runtime access error on execution. ... allocate ) ...
    (comp.lang.fortran)
  • Re: Maintaining a Dusty Deck
    ... > Hi Fortraners, ... > the program compiles, links, and runs okay. ... program into subroutine main and include everything after a "contains". ... This also gets those interfaces built for you. ...
    (comp.lang.fortran)