+2004-10-30 Canqun Yang <canqun@nudt.edu.cn>
+
+ * check.c (gfc_check_rand): Allow missing optional argument.
+ (gfc_check_irand): Ditto.
+ * intrinsic.c (add_functions): Set arg optional flag for {i,}rand.
+
2004-10-28 Scott Robert Ladd <scott.ladd@coyotegulch.com>
PR fortran/13490, PR fortran/17912
* gcc/fortran/gfortran.h: Added pedantic_min_int to gfc_integer_info
* gcc/fortran/gfortran.h: Added ARITH_ASYMMETRIC to arith
- * gcc/fortran/arith.c: Added support for an "asymmetric integer"
+ * gcc/fortran/arith.c: Added support for an "asymmetric integer"
warning when compiling with pedantic.
* gcc/fortran/arith.c: Set minimum integer values to reflect
realities of two's complement signed integers. Added
try
gfc_check_irand (gfc_expr * x)
{
+ if (x == NULL)
+ return SUCCESS;
+
if (scalar_check (x, 0) == FAILURE)
return FAILURE;
try
gfc_check_rand (gfc_expr * x)
{
+ if (x == NULL)
+ return SUCCESS;
+
if (scalar_check (x, 0) == FAILURE)
return FAILURE;
/* The following function is for G77 compatibility. */
add_sym_1 ("irand", 0, 1, BT_INTEGER, 4,
gfc_check_irand, NULL, NULL,
- i, BT_INTEGER, 4, 0);
+ i, BT_INTEGER, 4, 1);
make_generic ("irand", GFC_ISYM_IRAND);
/* The following function is for G77 compatibility. */
add_sym_1 ("rand", 0, 1, BT_REAL, 4,
gfc_check_rand, NULL, NULL,
- i, BT_INTEGER, 4, 0);
+ i, BT_INTEGER, 4, 1);
/* Compatibility with HP FORTRAN 77/iX Reference. Note, rand() and
ran() use slightly different shoddy multiplicative congruential
+2004-10-30 Canqun Yang <canqun@nudt.edu.cn>
+
+ * intrinsics/rand.c (irand): Handle NULL argument.
+
2004-10-07 Paul Brook <paul@codesourcery.com>
* io/transfer.c (finalize_transfer): Free internal streams.
prefix(irand) (GFC_INTEGER_4 *i)
{
- GFC_INTEGER_4 j = *i;
+ GFC_INTEGER_4 j;
+ if (i)
+ j = *i;
+ else
+ j = 0;
switch (j)
{