This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: RFA: Revamp fortran array types


Steve Kargl wrote:

On Wed, Aug 19, 2009 at 06:43:13PM +0200, Toon Moene wrote:


The following code is perfectly OK:

      DIMENSION A(10)
      A = 10.0
      CALL SUB(A,A)
      END
      SUBROUTINE SUB(A,B)
      REAL, INTENT(IN) :: A(:), B(:)

What happens if you replace the last line with


       REAL, INTENT(IN)  :: A(:)
       REAL, INTENT(OUT) :: B(:)


Fascinating. I *think* that - as long as you do not actually write to B - you're in the clear.


Of course, INTENT(OUT) :: B(:) also means you cannot read from B unless you set it before, so this basically amounts to an "unused" dummy argument. I wonder what -fwhole-file does with such an example ...

Paul ?

--
Toon Moene - e-mail: toon@moene.org - phone: +31 346 214290
Saturnushof 14, 3738 XG  Maartensdijk, The Netherlands
At home: http://moene.org/~toon/
Progress of GNU Fortran: http://gcc.gnu.org/gcc-4.5/changes.html


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]