(j3.2006) Disassociated array pointer actual argument corresponding to an optional argument of elemental procedure.
Daniel C Chen
cdchen
Wed Dec 10 10:39:53 EST 2014
Thank you all for the response.
Should the editing be part of the integration effort or we need an Interp
paper for meeting #206?
Thanks,
Daniel
XL Fortran Development - IBM Toronto Software Lab
Phone: 905-413-3056
Tie: 969-3056
Email: cdchen at ca.ibm.com
http://www.ibm.com/software/awdtools/fortran/xlfortran
From: Van Snyder <Van.Snyder at jpl.nasa.gov>
To: fortran standards email list for J3 <j3 at mailman.j3-fortran.org>
Date: 12/09/2014 21:00
Subject: Re: (j3.2006) Disassociated array pointer actual argument
corresponding to an optional argument of elemental procedure.
Sent by: j3-bounces at mailman.j3-fortran.org
On Wed, 2014-12-10 at 00:36 +0000, Bill Long wrote:
> On Dec 8, 2014, at 3:05 PM, Malcolm Cohen <malcolm at nag-j.co.jp> wrote:
>
> >
> >
> > Bill suggests:
> >> The call should have the same effect as
> >>
> >> call sub1 (arg2 = k)
> >>
> >> which is valid and results in a scalar call, since all of the actual
arguments
> >> are scalar.
> >
> > This is completely without merit, since whether P1 is declared
"INTEGER,POINTER"
> > or "INTEGER,OPTIONAL" makes no difference to the way that optionality
works.
> > I.e. that argument applies precisely to the exact case that item (6)
prohibits!
>
> Certainly it is undesirable for the above to be a valid alternative,
> but absent a restriction otherwise it is the logical consequence of
> the idea that the new forms of an actual argument being not present
> should be semantically the same as the actual argument being
> textually absent.
>
> I agree with Daniel?s observation that modifying (6) directly is the
> wrong context. We?re talking about a restriction on disassociated
> pointers, not on optional arguments not present. The analog of (1) in
> the same paragraph, except for disassociated pointers, is in 2.4.8p2.
> However, I think it would be more relevant to have the restriction in
> 12.5.2.12. Perhaps a new paragraph 5 for that subclause what says
> directly what we want:
The only cases in which a disassociated pointer is allowed to correspond
to a dummy argument are those where the dummy argument is a pointer, or
optional. The POINTER case is prohibited by C1289.
Therefore, the only case that needs attention is the concerning optional
arguments, for which 12.5.2.12p3(6) would work if the restriction
started with the dummy argument and worked backward to the actual
argument.
> "A disassociated array pointer shall not be supplied as an actual
argument to an elemental procedure unless an
> array of the same rank is supplied as an actual argument corresponding to
a nonoptional dummy
> argument of that elemental procedure."
>
> Cheers,
> Bill
>
>
>
> >
> > We prohibit that case for good reason, and one of those good reasons is
that
> > allowing it would make it trivial to construct a generic reference that
could
> > not be resolved at compile-time (because the rank of a function
reference would
> > depend on whether a pointer was associated). Thus violating one of the
> > fundamental principles of generic resolution.
> >
> > Cheers,
> > --
> > ................................Malcolm Cohen, Nihon NAG, Tokyo.
> >
> > _______________________________________________
> > J3 mailing list
> > J3 at mailman.j3-fortran.org
> > http://mailman.j3-fortran.org/mailman/listinfo/j3
>
> Bill Long
longb at cray.com
> Fortran Technical Suport & voice:
651-605-9024
> Bioinformatics Software Development fax:
651-605-9142
> Cray Inc./ Cray Plaza, Suite 210/ 380 Jackson St./ St. Paul, MN 55101
>
>
> _______________________________________________
> J3 mailing list
> J3 at mailman.j3-fortran.org
> http://mailman.j3-fortran.org/mailman/listinfo/j3
_______________________________________________
J3 mailing list
J3 at mailman.j3-fortran.org
http://mailman.j3-fortran.org/mailman/listinfo/j3
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.j3-fortran.org/pipermail/j3/attachments/20141210/96a06841/attachment-0001.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: graycol.gif
Type: image/gif
Size: 105 bytes
Desc: not available
Url : http://mailman.j3-fortran.org/pipermail/j3/attachments/20141210/96a06841/attachment-0001.gif
More information about the J3
mailing list