This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/25029] Assumed size array can be associated with array pointer without upper bound of last dimension

------- Comment #1 from eedelman at gcc dot gnu dot org  2005-11-25 15:37 -------

A few comments:

Since the subroutine foo isn't called, we can't expect any output.  If,
however, we add a the line

call foo(a)

after the line

a(1:4) = 1

we still don't get any output (or, to be precise, we get an empty line).  In
any case, the pointer assignment shouldn't be allowed, since no size
information is available for the dummy m (p => m(1:4) would be OK).

A similar problem occours is if we have code like

program ptrtest
  implicit none
  integer a(4)

  a(1:4) = 1
  call foo(a)


subroutine foo(m)
    integer, target :: m(*)
    integer :: p

    p = sum(m)

    print *, p
end subroutine
end program

Again, gfortran should print an errormessage, but doesn't (running the
executable prints 0).


eedelman at gcc dot gnu dot org changed:

           What    |Removed                     |Added
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
           Keywords|                            |diagnostic
   Last reconfirmed|0000-00-00 00:00:00         |2005-11-25 15:37:41
               date|                            |

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]