g95 bug, save -- module -- pure function

2 views
Skip to first unread message

Ugo

unread,
Mar 26, 2008, 7:16:36 AM3/26/08
to gg95
--- Also sent to Andy, as a bug report ---

=== The code ===
$ cat g95bug.f90
module g95bug
save
integer :: i=20

contains

pure function tell_i() result (answer)
integer :: answer
answer=i
end function tell_i

end module g95bug


=== Error message ===
$ g95 -c g95bug.f90
In file g95bug.f90:3

integer :: i=20
1
Error: Variable 'i' at (1) cannot be SAVEd in a PURE procedure

=== G95 version ==
$ g95 --version
G95 (GCC 4.0.3 (g95 0.91!) Feb 26 2008)
Copyright (C) 2002-2005 Free Software Foundation, Inc.
...
Reply all
Reply to author
Forward
0 new messages