Index Home About Blog
From:  robert.corbett@sun.com
Newsgroups: comp.lang.fortran
Subject: Re: Errors in Fortran standards
Date: Fri, 17 Aug 2007 22:16:57 -0700
Message-ID: <1187414217.097237.40220@j4g2000prf.googlegroups.com>

On Aug 16, 3:49 pm, har...@mcs.vuw.ac.nz (John Harper) wrote:

> What if there has been an interp that a later standard doesn't follow?
> Recently, believing MR&C on optional dummy arguments of MAX, I sent a
> bug report to a vendor whose f95 core-dumped at run time after the
> first PRINT statement in this program:
>
>   PROGRAM testoptarg
>     PRINT *, m1(3,4)
>     PRINT *, m1(3)
>     PRINT *, m1()
>   CONTAINS
>     INTEGER FUNCTION m1(a1,a2)
>       INTEGER, OPTIONAL, INTENT(IN) :: a1,a2
>       m1 = max(1, 2, a1, a2) ! are args of max after the 2nd optional?
>     END FUNCTION m1
>   END PROGRAM testoptarg
>
> The vendor's reply was
>
> < It is a subtle point.  The program would be standard conforming
> < if the dummy arguments to MAX beyond the second dummy argument
> < are optional.  Section 13.2 of the Fortran 2003 standard states
> <     Many of the intrinsic procedures have optional arguments.
> <     The arguments are identified by the notation "optional"
> <     in the argument descriptions.  In addition, the names of
> <     the optional arguments are enclosed in square brackets in
> <     description heading and in lists of procedures.
> < The arguments to MAX do not have the notation "optional" in the
> < argument description for MAX, but the arguments beyond the
> < second argument are enclosed in square brackets.
>
> However http://j3-fortran.org/doc/standing/links/015.txt contains
> an interp saying that "optional" should have been in the description
> of MAX in f95 13.14.64, and that that would go in F95 Corrigendum 3
> if there were one. The correction does not appear in f2008 13.7.114.
> Is the vendor referred to above right, or should I send bug reports to
> the authors of MR&C and the vendors of compilers that executed all
> three PRINT statements?

I am the vendor representative cited.  After the reading the
interpretation, I agreed that the optional actual arguments
should be allowed.  Even if the interpretation had gone the
other way, there would be no reason to send a bug report to the
vendors of the compilers that executed all three PRINT
statements.  In that case, the program would not have been
standard-conforming, and any behavior would be permitted.

In my response, I said that I hate the committee's practice of
not fixing problems in the standard such as this one.  The people
who filed the request for interpretation were two senior members
of the committee.  If they found it unclear, I find it hard to
accept the statement in the interpretation that "the intent is
clear."

Bob Corbett


Index Home About Blog