Is there a PR open for this code?

Dominique Dhumieres dominiq@lps.ens.fr
Thu Sep 11 12:00:00 GMT 2008


Is there a PR open for for he following code?

         program no_leak
             real, dimension(100) :: x, y
             x=(/(i, i=1, n)/)
             y(:size(compact(x))) = compact(x)**2
             print *, y(100)
           contains
           function compact(x)
             real,allocatable,dimension(:) :: compact
             real,dimension(:),intent(in) :: x
             integer             :: n
             n = size(x)
             allocate(compact(n))
           end function compact
          end

It always compiles, but half of the time (depending on the build) the executable
gives a "Bus error" (on Darwin).  I am sure to have borrowed this code somewhere,
but I cannot remember where.

TIA

Dominique



More information about the Fortran mailing list