This is the mail archive of the gcc-bugs@gcc.gnu.org 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/32319] Bad automatic array argument



------- Comment #1 from dfranke at gcc dot gnu dot org  2007-06-13 15:57 -------
If you would provide an explicit interface for AA, the binary would not
segfault:

$> cat pr32319.f90
program ff
  implicit none
  integer,dimension(4)::w
  w=1
  write(*,*)w
  call aa(w(2:3))
  write(*,*)w
contains
  subroutine aa(v)
    integer,dimension(:),intent(out)::v
    write(*,*)size(v)
    v=0
  end subroutine aa
end

$> gfortran-svn pr32319.f90 && ./a.out
           1           1           1           1
           2
           1           0           0           1


Without explicit interface, the binary produced by ifort crashes the same way
as the one generated by gfortran, sunf95 issues this message on the original
code:

$> sunf95 -w4 pr32319.f90

call aa(w(1:5))
^
"pr32319.f90", Line = 13, Column = 1: ERROR: Procedure "AA" is defined at line
1 (pr32319.f90).  It must have an explicit interface specified.


-- 

dfranke at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dfranke at gcc dot gnu dot
                   |                            |org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32319


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