From: Janne Blomqvist Date: Sun, 16 Oct 2016 06:28:15 +0000 (+0300) Subject: PR 48587 Newunit allocator, cleanup X-Git-Tag: upstream/12.2.0~44009 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9937c1eb7288216e4b59303389d64ff1125516f0;p=platform%2Fupstream%2Fgcc.git PR 48587 Newunit allocator, cleanup Improve error message, and remove a redundant check, as the same check is done a bit earlier due to the PR 48587 patch. 2016-10-16 Janne Blomqvist PR libfortran/48587 * io/transfer.c (data_transfer_init): Improve error message, remove redundant check. Regtested on x86_64-pc-linux-gnu. From-SVN: r241211 --- diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog index bf7af2b..bfda86d 100644 --- a/libgfortran/ChangeLog +++ b/libgfortran/ChangeLog @@ -1,3 +1,9 @@ +2016-10-16 Janne Blomqvist + + PR libfortran/48587 + * io/transfer.c (data_transfer_init): Improve error message, + remove redundant check. + 2016-10-15 Janne Blomqvist PR libfortran/48587 diff --git a/libgfortran/io/transfer.c b/libgfortran/io/transfer.c index 7696cca..2232417 100644 --- a/libgfortran/io/transfer.c +++ b/libgfortran/io/transfer.c @@ -2606,7 +2606,8 @@ data_transfer_init (st_parameter_dt *dtp, int read_flag) /* This means we tried to access an external unit < 0 without having opened it first with NEWUNIT=. */ generate_error (&dtp->common, LIBERROR_BAD_OPTION, - "Invalid unit number in statement"); + "Unit number is negative and unit was not already " + "opened with OPEN(NEWUNIT=...)"); return; } else if (dtp->u.p.current_unit->s == NULL) @@ -2614,14 +2615,6 @@ data_transfer_init (st_parameter_dt *dtp, int read_flag) st_parameter_open opp; unit_convert conv; - if (dtp->common.unit < 0 && !is_internal_unit (dtp)) - { - close_unit (dtp->u.p.current_unit); - dtp->u.p.current_unit = NULL; - generate_error (&dtp->common, LIBERROR_BAD_OPTION, - "Bad unit number in statement"); - return; - } memset (&u_flags, '\0', sizeof (u_flags)); u_flags.access = ACCESS_SEQUENTIAL; u_flags.action = ACTION_READWRITE;