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/30964] optional arguments to random_seed



------- Comment #5 from fxcoudert at gcc dot gnu dot org  2007-05-22 09:23 -------
There's more to it. When generate wrong-code for optional arguments, as shown
by the following code:

$ cat b.f90 
program trs
  implicit none
  integer :: size, ierr
  integer, allocatable, dimension(:) :: seed
  call random_seed(size)
  allocate(seed(size), stat=ierr)
  if (ierr /= 0) stop
  call test_random_seed()
contains
  subroutine test_random_seed(get)
    integer, dimension(:), optional :: get
    call random_seed(get=get)
  end subroutine test_random_seed
end program trs
$ gfortran b.f90 && ./a.out
Segmentation fault


-- 

fxcoudert at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |major
           Keywords|                            |wrong-code


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


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