This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran 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]

Is this valid ?


    integer, parameter :: n = 1

    call modify_n (n)
    print *, n

    contains

      subroutine modify_n (i)
      integer :: i
      do while (i < 4)
        print *, i
        i = i+1
      end do
      end subroutine

    end


After my fight with expressions vs variables in PR35681, I would say
that n should be seen as a (constant) expression, and a temp should be
made for it.

If not, what about this case ?

    call modify_n (1)


Both fail at runtime with a segmentation fault (access to read-only
memory I guess).


Mikael


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