diff options
author | jb <jb@138bc75d-0d04-0410-961f-82ee72b054a4> | 2016-10-16 06:28:15 +0000 |
---|---|---|
committer | jb <jb@138bc75d-0d04-0410-961f-82ee72b054a4> | 2016-10-16 06:28:15 +0000 |
commit | d9b9453994a95ed3a76fe99a280a1db6168a45b3 (patch) | |
tree | a341f4354565e5e662dd7a014dc22f320f207565 /libgfortran/io | |
parent | 948ad72663d69b1e7744769cf77edfed3d10cbf1 (diff) | |
download | gcc-d9b9453994a95ed3a76fe99a280a1db6168a45b3.tar.gz |
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 <jb@gcc.gnu.org>
PR libfortran/48587
* io/transfer.c (data_transfer_init): Improve error message,
remove redundant check.
Regtested on x86_64-pc-linux-gnu.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@241211 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgfortran/io')
-rw-r--r-- | libgfortran/io/transfer.c | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/libgfortran/io/transfer.c b/libgfortran/io/transfer.c index 7696cca2306..2232417af6b 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; |