This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/30964] optional arguments to random_seed
- From: "fxcoudert at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 22 May 2007 08:23:56 -0000
- Subject: [Bug fortran/30964] optional arguments to random_seed
- References: <bug-30964-10391@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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