diff options
author | pbrook <pbrook@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-10-30 14:18:34 +0000 |
---|---|---|
committer | pbrook <pbrook@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-10-30 14:18:34 +0000 |
commit | da1ce3b9299c3042a402ab93e2e8edc17fed7187 (patch) | |
tree | 7000c863d0f16b0b8e5755c5819227f439868d5f /libgfortran | |
parent | 640e9781c56488a14e708bc7bc21b2371870dc6b (diff) | |
download | gcc-da1ce3b9299c3042a402ab93e2e8edc17fed7187.tar.gz |
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.
libgfortran/
* intrinsics/rand.c (irand): Handle NULL argument.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@89886 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgfortran')
-rw-r--r-- | libgfortran/ChangeLog | 4 | ||||
-rw-r--r-- | libgfortran/intrinsics/rand.c | 6 |
2 files changed, 9 insertions, 1 deletions
diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog index aafa660ccf5..e2057a1f2f5 100644 --- a/libgfortran/ChangeLog +++ b/libgfortran/ChangeLog @@ -1,3 +1,7 @@ +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. diff --git a/libgfortran/intrinsics/rand.c b/libgfortran/intrinsics/rand.c index d59e1688371..f4e78d0470e 100644 --- a/libgfortran/intrinsics/rand.c +++ b/libgfortran/intrinsics/rand.c @@ -51,7 +51,11 @@ GFC_INTEGER_4 prefix(irand) (GFC_INTEGER_4 *i) { - GFC_INTEGER_4 j = *i; + GFC_INTEGER_4 j; + if (i) + j = *i; + else + j = 0; switch (j) { |