This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/44856] Usage of array PARAMETERs: Literal copy vs. global variable
- From: "burnus at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 8 Dec 2010 16:28:19 +0000
- Subject: [Bug fortran/44856] Usage of array PARAMETERs: Literal copy vs. global variable
- Auto-submitted: auto-generated
- References: <bug-44856-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44856
--- Comment #3 from Tobias Burnus <burnus at gcc dot gnu.org> 2010-12-08 16:28:07 UTC ---
Other example - from James,
cf.
http://groups.google.com/group/comp.lang.fortran/browse_thread/thread/1a695db0fcfaa3e9
program kindtest
use ISO_FORTRAN_ENV
implicit none
integer i
REAL_KINDS(1) = 42
i = sum([(kind(real(0,REAL_KINDS(i))),i=1,size(REAL_KINDS))])
write(*,*) i
end program kindtest
which is rejected with
Error: 'kind' argument of 'real' intrinsic at (1) must be a constant
A quick test shows that for locally defined parameter arrays, only NAG f95 is
able to use it as KIND= argument to REAL. While g95, Intel, pathf95 and openf95
have the same problem as gfortran.