[Patch, fortran] PR18578, PR18579, PR20857 and PR20885 - Constraints on INTENT(OUT and INOUT)

Steve Kargl sgk@troutmask.apl.washington.edu
Sat Feb 18 18:35:00 GMT 2006


On Sun, Jan 29, 2006 at 12:13:34PM +0000, Paul Brook wrote:
> On Sunday 29 January 2006 06:55, Paul Thomas wrote:
> > This patch implements the obvious constraints on the use of INTENT(OUT
> > and INOUT).  ie: that the actual argument should be a variable
> > ("definable" in the standard) and that INTENT(OUT) variables should be
> > defined or intialized before they are used or before return from the
> > procedure.
> 
> Variables that aren't defined should be caught be the normal unused 
> parameter/variable warnings. AFAIK there's nothing special about INTENT(OUT) 
> that requires it be defined.
> 

pault is almost quoting the language from the standard.  See page 53.

   The INTENT(OUT) attribute specifies that the dummy argument shall
   be defined before a reference to the dummy argument is made within
   the procedure and any actual argument that becomes associated with
   such a dummy argument shall be definable.  On invocation of the
   procedure, such a dummy argument becomes undefined except for
   components of an object of derived type for which default
   initialization has been specified.

   The INTENT(INOUT) attribute specifies that the dummy argument is
   intended for use both to receive data from and to return data to
   the invoking scoping unit.  Any actual argument that becomes
   associated with such a dummy argument shall be definable.

-- 
Steve



More information about the Fortran mailing list