This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/37159] New: RANDOM_SEED: PUT= check array size at compile time
- From: "burnus at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 19 Aug 2008 06:28:21 -0000
- Subject: [Bug fortran/37159] New: RANDOM_SEED: PUT= check array size at compile time
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
The run-time library has:
static const GFC_INTEGER_4 kiss_size =
sizeof(kiss_seed)/sizeof(kiss_seed[0]);
if (((put->dim[0].ubound + 1 - put->dim[0].lbound)) < kiss_size)
runtime_error ("Array size of PUT is too small.");
It would be great if the size could already be checked at compile time:
integer size(6)
CALL RANDOM_SEED(size=size(1))
print *, size(1)
CALL RANDOM_SEED(put=size)
end
$ ./a.out
8
Fortran runtime error: Array size of PUT is too small.
Note: If HAVE_GFC_REAL_16 is set, size is larger than 8.
Vector too small for argument PUT (no. 2) of intrinsic RANDOM_SEED
NAG f95 checks things at compile time:
Error: Vector too small for argument PUT (no. 2) of intrinsic RANDOM_SEED
--
Summary: RANDOM_SEED: PUT= check array size at compile time
Product: gcc
Version: 4.4.0
Status: UNCONFIRMED
Keywords: diagnostic
Severity: normal
Priority: P3
Component: fortran
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: burnus at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37159