(j3.2006) Storage sequence and alignment

Keith Bierman khbkhb
Wed Sep 28 15:44:23 EDT 2011


On Wed, Sep 28, 2011 at 1:39 PM, Rasmussen, Craig E <rasmussn at lanl.gov>wrote:

Someone please tell me I'm wrong and that all legal Fortran programs are
> good programs.


Surely you jest; most legal programs are bad :> Good programs are hard to
write. Bad ones are easy to write.

The MPI Forum is attempting to get the notion of storage sequence correct.
>  In particular we are trying to divine what the standard says as to storage
> sequence and alignment.
>
> In particular, in 16.5.3.2:
>
> a nonpointer scalar object of sequence type with no type parameters
> occupies a sequence of storage sequences corresponding to the sequence of
> its ultimate components,
>
> It seems to me that you can build a legal Fortran program that is
> guaranteed to crash on some architectures when using a sequence type and an
> assortment of single and double precision components in a random order.
>
>
> The Fortran standard doesn't require programs to be valid on any and all
systems. Most Fortran Processors employ padding to ensure that users don't
hurt themselves too badly. And programs which follow good practices won't
get people into too much trouble. But historically, one can use/abuse
various facilities (e.g. EQUIVALENCE) to do very Evil things to get behind
the Processor's back. Evil Things can do Evil Things, including crashing the
system (well, at least the process. Few OS's still make it trivial to take
the entire system down due to a poorly behaving process)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://j3-fortran.org/pipermail/j3/attachments/20110928/1be7bdef/attachment.html>



More information about the J3 mailing list