fortran/2153: statement function arg namespace overlaps subr namespace
Billinghurst, David (CRTS)
David.Billinghurst@riotinto.com
Sun Apr 1 00:00:00 GMT 2001
The following reply was made to PR fortran/2153; it has been noted by GNATS.
From: "Billinghurst, David (CRTS)" <David.Billinghurst@riotinto.com>
To: "'gcc-gnats@gcc.gnu.org'" <gcc-gnats@gcc.gnu.org>,
"'crussell@uabmc.edu'" <crussell@uabmc.edu>, nobody@gcc.gnu.org
Cc: gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org
Subject: RE: fortran/2153: statement function arg namespace overlaps subr
namespace
Date: Sun, 4 Mar 2001 00:37:40 -0000
Your program does not conform to the Fortran 77 standard so g77 is allowed
to reject it. See section 15.4 of ANSI X3.9 (1978). There are a number of
online copies of this document available - try www.fortran.com for some
pointers
Paraphasing slightly the arguement(s) of a statement function:
o has the scope of the surrounding program unit
o cannot be an arrays
+++++++++++++++++++++++++++++++++++++++++
(Mr) David Billinghurst
Comalco Research Centre
PO Box 316, Thomastown, Vic, Australia, 3074
Phone: +61 3 9469 0642
FAX: +61 3 9462 2700
Email: David.Billinghurst@riotinto.com
> -----Original Message-----
> From: crussell@uabmc.edu [SMTP:crussell@uabmc.edu]
> Sent: Saturday, 3 March 2001 9:34
> To: nobody@gcc.gnu.org
> Cc: gcc-prs@gcc.gnu.org; gcc-bugs@gcc.gnu.org
> Subject: fortran/2153: statement function arg namespace overlaps subr
> namespace
>
>
> >Number: 2153
> >Category: fortran
> >Synopsis: statement function arg namespace overlaps subr namespace
> >Confidential: no
> >Severity: non-critical
> >Priority: low
> >Responsible: unassigned
> >State: open
> >Class: sw-bug
> >Submitter-Id: net
> >Arrival-Date: Fri Mar 02 14:36:00 PST 2001
> >Closed-Date:
> >Last-Modified:
> >Originator: Charles D. Russell, Nucl Med Div, UAB Hospital, B'ham AL
> >Release: gcc 295.2-6 19991024 (cygwin experimental)
> >Organization:
> >Environment:
> Windows 98
> >Description:
> g77 bug report: simple example provided
> (gcc version 2.95.2-6 19991024 (cygwin experimental)
>
> dummy variable in function statement seems to fall into same name space as
> subroutine arguments. Changing x to dum in function statement fixes the
> problem.
>
> subroutine bug (n,x,y)
> c implicit double precision (a-h,o-z)
> dimension x(n)
> c
> c override intrinsic to convert writes to single precision
> sngl(x)=x
> write(*,*) 'y=',sngl(y)
> return
> end
>
> leads to message:
>
> g77 -c -o bug.o bug.f
> bug.f: In subroutine `bug':
> bug.f:2:
> subroutine bug (n,x,y)
> 1
> bug.f:7: (continued):
> sngl(x)=x
> 2
> Invalid declaration of or reference to symbol `x' at (2) [initially seen
> at (1)]
> make: *** [bug.o] Error 1
> >How-To-Repeat:
>
> >Fix:
>
> >Release-Note:
> >Audit-Trail:
> >Unformatted:
More information about the Gcc-prs
mailing list