This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Is this valid ?
- From: Mikael Morin <mikael dot morin at tele2 dot fr>
- To: gfortran <fortran at gcc dot gnu dot org>
- Date: Mon, 17 Nov 2008 12:34:29 +0100
- Subject: 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