+2016-10-16 Janne Blomqvist <jb@gcc.gnu.org>
+
+ PR libfortran/48587
+ * io/transfer.c (data_transfer_init): Improve error message,
+ remove redundant check.
+
2016-10-15 Janne Blomqvist <jb@gcc.gnu.org>
PR libfortran/48587
/* 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)
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;