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