This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/35299] scope of variables in statement function do not acquire rank from host
- From: "sgk at troutmask dot apl dot washington dot edu" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 29 Feb 2008 20:15:08 -0000
- Subject: [Bug fortran/35299] scope of variables in statement function do not acquire rank from host
- References: <bug-35299-10110@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #3 from sgk at troutmask dot apl dot washington dot edu 2008-02-29 20:15 -------
Subject: Re: scope of variables in statement function do not acquire rank from
host
On Fri, Feb 29, 2008 at 05:53:40PM -0000, fxcoudert at gcc dot gnu dot org
wrote:
> I disagree. In Fortran 2003 12.5.4, C1263/R1238 says "The function-name and
> each dummy-arg-name shall be specified, explicitly or implicitly, to be
> scalar.". Intel accepts it, but IBM, g95 and (most importantly) Lahey think
> it's invalid.
>
>
> However, the error message should point to the statement function. The patch
> below gives, in my opinion, a better error message:
>
> HSTAR(E,B)=B**.4*((1.25*FUN(-E/40)+.18)) ! Doesn't work.
> 1
> Error: Argument 'e' of statement function 'hstar' at (1) must be scalar
>
I disagree with your disagreement. :-) Gordon Sande and Richard Maine
also disagrees with you (see c.l.f threads "I've never seen this
before in 30 years - what is this?" and "What is this").
>From Fortran 95, Sec. 12.5.4, lines 38 and 39:
The dummy arguments have a scope of the statement function. Each
dummy argument has the same type and type parameters as the
entity of the same name in the scoping unit containing the statement
function.
Note, this passage does not include rank.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35299