From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1998 invoked by alias); 19 Aug 2008 06:29:44 -0000 Received: (qmail 1660 invoked by uid 48); 19 Aug 2008 06:28:21 -0000 Date: Tue, 19 Aug 2008 06:29:00 -0000 Subject: [Bug fortran/37159] New: RANDOM_SEED: PUT= check array size at compile time X-Bugzilla-Reason: CC Message-ID: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "burnus at gcc dot gnu dot org" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2008-08/txt/msg01360.txt.bz2 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