public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* fortran/7662: Dimensions of dummy array in subroutine must agree with arrayed passed from calling program.
@ 2002-08-20 12:06 mark.e.smith
  0 siblings, 0 replies; 3+ messages in thread
From: mark.e.smith @ 2002-08-20 12:06 UTC (permalink / raw)
  To: gcc-gnats


>Number:         7662
>Category:       fortran
>Synopsis:       Dimensions of dummy array in subroutine must agree with arrayed passed from calling program.
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Aug 20 11:46:01 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     mark.e.smith@arnold.af.mil
>Release:        unknown-1.0
>Organization:
>Environment:
Redhat Linux 7.2
GNU Fortran 0.5.26 20000731 (Red Hat Linux 7.1 2.96-98)
>Description:
A dummy array in a subroutine must be at least as large as the passed array in each of it's dimensions. G77 fails if the dimensions of the dummy array are not exactly the same as the passed array.
>How-To-Repeat:
Here is a sample program that demonstrates the problem

      dimension x(3,4)
      data x/1,2,3,4,5,6,7,8,9,10,11,12/
      
      print *, 'Correct Array'
      do i = 1,3
         print*, (x(i,j), j=1,4)
      enddo
      
      print *
      print *, 'Array in Sub'
      call prarray(3,4,x)
      end
      
      subroutine prarray(m,n,dumx)
      dimension dumx(5,8)
      do i = 1,m
         print*, (dumx(i,j), j=1,n)
      enddo
      return
      end


>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: fortran/7662: Dimensions of dummy array in subroutine must agree with arrayed passed from calling program.
@ 2002-08-21  2:06 toon
  0 siblings, 0 replies; 3+ messages in thread
From: toon @ 2002-08-21  2:06 UTC (permalink / raw)
  To: gcc-bugs, gcc-prs, mark.e.smith, nobody, toon

Synopsis: Dimensions of dummy array in subroutine must agree with arrayed passed from calling program.

Responsible-Changed-From-To: unassigned->toon
Responsible-Changed-By: toon
Responsible-Changed-When: Wed Aug 21 00:54:30 2002
Responsible-Changed-Why:
    Fortran Maintainer.
State-Changed-From-To: open->closed
State-Changed-By: toon
State-Changed-When: Wed Aug 21 00:54:30 2002
State-Changed-Why:
    Not a compiler bug.
    
    The extents of dummy argument arrays must indeed be the
    same as that of the actual argument; if they're not, that's
    a programmer error.
    
    Use:
    
          SUBROUTINE SUB(M,N,DUMX)
          DIMENSION DUMX(M,N)
          ...

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=7662


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: fortran/7662: Dimensions of dummy array in subroutine must agree with arrayed passed from calling program.
@ 2002-08-20 21:36 Tim Prince
  0 siblings, 0 replies; 3+ messages in thread
From: Tim Prince @ 2002-08-20 21:36 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

The following reply was made to PR fortran/7662; it has been noted by GNATS.

From: Tim Prince <tprince@computer.org>
To: mark.e.smith@arnold.af.mil, gcc-gnats@gcc.gnu.org
Cc:  
Subject: Re: fortran/7662: Dimensions of dummy array in subroutine must agree with arrayed passed from calling program.
Date: Tue, 20 Aug 2002 21:04:39 -0700

 On Tuesday 20 August 2002 11:44, mark.e.smith@arnold.af.mil wrote:
 > >Number:         7662
 > >Category:       fortran
 > >Synopsis:       Dimensions of dummy array in subroutine must agree with
 > > arrayed passed from calling program. Confidential:   no
 > >Severity:       serious
 > >Priority:       medium
 > >Responsible:    unassigned
 > >State:          open
 > >Class:          sw-bug
 > >Submitter-Id:   net
 > >Arrival-Date:   Tue Aug 20 11:46:01 PDT 2002
 > >Closed-Date:
 > >Last-Modified:
 > >Originator:     mark.e.smith@arnold.af.mil
 > >Release:        unknown-1.0
 > >Organization:
 > >Environment:
 >
 > Redhat Linux 7.2
 > GNU Fortran 0.5.26 20000731 (Red Hat Linux 7.1 2.96-98)
 >
 > >Description:
 >
 > A dummy array in a subroutine must be at least as large as the passed array
 > in each of it's dimensions. G77 fails if the dimensions of the dummy array
 > are not exactly the same as the passed array.
 >
 > >How-To-Repeat:
 >
 > Here is a sample program that demonstrates the problem
 >
 >       dimension x(3,4)
 >       data x/1,2,3,4,5,6,7,8,9,10,11,12/
 >
 >       print *, 'Correct Array'
 >       do i = 1,3
 >          print*, (x(i,j), j=1,4)
 >       enddo
 >
 >       print *
 >       print *, 'Array in Sub'
 >       call prarray(3,4,x)
 >       end
 >
 >       subroutine prarray(m,n,dumx)
 >       dimension dumx(5,8)
 >       do i = 1,m
 >          print*, (dumx(i,j), j=1,n)
 >       enddo
 >       return
 >       end
 >
 > >Fix:
 > >
 > >Release-Note:
 > >Audit-Trail:
 > >Unformatted:
 The statements made above conflict with the wording of the standard.  It 
 might be useful if g77 could diagnose such violations of the standard, or 
 simply warn about apparent disagreements in passing arguments, but I see no 
 obligation for g77 to make a useful interpretation of this code. In fact, all 
 3 Fortran compilers which I have installed on linux treat this code about the 
 same, and fail to catch the out of bounds addressing.
 -- 
 Tim Prince


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2002-08-21  7:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-08-20 12:06 fortran/7662: Dimensions of dummy array in subroutine must agree with arrayed passed from calling program mark.e.smith
2002-08-20 21:36 Tim Prince
2002-08-21  2:06 toon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).