(j3.2006) F03/0110

Van Snyder Van.Snyder
Thu Aug 25 21:47:21 EDT 2011


If you change your main program to

      PROGRAM MAIN
      X = T()
      END

then a value is not computed for T.  Yes, an assignment statement
appears in the function, but it doesn't get executed, so no value for
the function result variable is defined.

On Thu, 2011-08-25 at 18:09 -0700, Robert Corbett wrote:
> The answer given for interpretation F03/0110 says that
> the example
> 
>       FUNCTION S()
>       T = 13.0
>       ENTRY T()
>       END
> 
> is not standard-conforming "since no return value
> is set for T()."
> 
> Consider the program
> 
>       FUNCTION S()
>       T = 13.0
>       ENTRY T()
>       END
> 
>       PROGRAM MAIN
>       X = S()
>       END
> 
> Clause 1.5 of 10-007r1 defines a standard-conforming
> program as
> 
>      A program (2.2.2) is a standard-conforming
>      program if it uses only those forms and
>      relationships described herein and if the
>      program has an interpretation according to
>      this part of ISO/IEC 1539.
> 
> The program shown above "uses only the forms and
> relationships" described in 10-007r1.  It also
> "has an interpretation" according to 10-007r1,
> albeit an uninteresting one.  The result variables
> S and T are storage associated (see paragraph 3 of
> Clause 12.6.2.6) and so the assignment to T causes
> S to be defined.  Thus, the requirement
> 
>      If the result variable is not a pointer,
>      its value shall be defined by the function.
> 
> (paragraph 4 of Clause 12.6.2.2) is satisfied.
> 
> I find it difficult to understand how a program that
> is standard conforming can contain a function that
> is not standard conforming.
> 
> Robert Corbett
> _______________________________________________
> J3 mailing list
> J3 at j3-fortran.org
> http://j3-fortran.org/mailman/listinfo/j3




More information about the J3 mailing list