Pointers to derived type objects in COMMON



Fellow clfers,

Consider the following:

subroutine commonptr ()
implicit none

type wws_t ! No SEQUENCE and has default initialization
integer :: x = 1, y = 2, z = 3
end type

type (wws_t), pointer :: my_wwsptr
common /block/ my_wwsptr

allocate (my_wwsptr)
my_wwsptr = wws_t (3, 4, 5)

end subroutine

We all know that for a derived type object to reside in COMMON, it
must have a SEQUENCE attribue, and must not have default initialization
specified. These are documented in constraint C589 in §5.5.2 of F2003:

"C589 (R558) If a common-block-object is of a derived type, it shall be
a sequence type or a type with the BIND attribute and it shall have no
default inititialization."

But what about *pointers* to the objects? If I merely want to place
a pointer to the object in the COMMON block, my reading of §5.5.2
says that it is legal to allow the pointer regardless. PGI and
Salford/Silverfrost allow the above code. However ifort, gfortran,
g95, IRIX f90, and others do not allow it.

Opinions?

W.
.



Relevant Pages

  • Re: Cohens paper on byte order
    ... > depend on the applicability of the common hex notation. ... bit sequence, there is a bit-order-within-unit issue for ... *any* multibit storage units, not just octet units, and ... fact true of almost all data storage and transmission ...
    (sci.crypt)
  • Re: World Moonie Herald: The challenge to Darwins theory of evolution - 5
    ... Denton presented his critique of neo-Darwinism based on the latest ... all types of cytochrome-c is similar and therefore common. ... amino-acid sequence differs according to organisms. ...
    (talk.origins)
  • Re: Cantors definition of set
    ... I would not like to say that they have anything in common. ... of the signs we use to portray numbers, ... arranged in a sequence and not numbers after all? ...
    (sci.logic)
  • Re: Article: On the Origins of Chemical Biodefense
    ... >> There is a controversy in the field of molecular evolution. ... >> of sequence similarity could be lost in regions that must preserve ... > It's very strange to hear Larry arguing for convergence - this is the ... a common and important mechanism of evolution. ...
    (sci.bio.evolution)
  • Re: Page Coloring Defines in vm_page.h
    ... If you generate a sequence ... For every array length n and every stride p, that has no common ... Let's assume that f is not an injection, ... Since array lengths, that are powers of 2, are relatively prime to every ...
    (freebsd-hackers)