Commit f5c64803 by Jerry DeLisle

re PR fortran/38425 (I/O: POS= compile-time diagnostics)

2008-12-06  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR fortran/38425
	* io.c (check_io_constraints): Check constraints on REC=, POS=, and
	internal unit with POS=. Fix punctuation on a few error messages.

From-SVN: r142534
parent 1dff2af7
2008-12-06 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR fortran/38425
* io.c (check_io_constraints): Check constraints on REC=, POS=, and
internal unit with POS=. Fix punctuation on a few error messages.
2008-12-06 Janus Weil <janus@gcc.gnu.org> 2008-12-06 Janus Weil <janus@gcc.gnu.org>
PR fortran/38415 PR fortran/38415
......
...@@ -2931,6 +2931,10 @@ if (condition) \ ...@@ -2931,6 +2931,10 @@ if (condition) \
io_constraint (dt->rec != NULL, io_constraint (dt->rec != NULL,
"REC tag at %L is incompatible with internal file", "REC tag at %L is incompatible with internal file",
&dt->rec->where); &dt->rec->where);
io_constraint (dt->pos != NULL,
"POS tag at %L is incompatible with internal file",
&dt->pos->where);
io_constraint (unformatted, io_constraint (unformatted,
"Unformatted I/O not allowed with internal unit at %L", "Unformatted I/O not allowed with internal unit at %L",
...@@ -3169,7 +3173,7 @@ if (condition) \ ...@@ -3169,7 +3173,7 @@ if (condition) \
io_constraint (dt->format_expr, io_constraint (dt->format_expr,
"IO spec-list cannot contain both NAMELIST group name " "IO spec-list cannot contain both NAMELIST group name "
"and format specification at %L.", "and format specification at %L",
&dt->format_expr->where); &dt->format_expr->where);
io_constraint (dt->format_label, io_constraint (dt->format_label,
...@@ -3178,22 +3182,26 @@ if (condition) \ ...@@ -3178,22 +3182,26 @@ if (condition) \
io_constraint (dt->rec, io_constraint (dt->rec,
"NAMELIST IO is not allowed with a REC= specifier " "NAMELIST IO is not allowed with a REC= specifier "
"at %L.", &dt->rec->where); "at %L", &dt->rec->where);
io_constraint (dt->advance, io_constraint (dt->advance,
"NAMELIST IO is not allowed with a ADVANCE= specifier " "NAMELIST IO is not allowed with a ADVANCE= specifier "
"at %L.", &dt->advance->where); "at %L", &dt->advance->where);
} }
if (dt->rec) if (dt->rec)
{ {
io_constraint (dt->end, io_constraint (dt->end,
"An END tag is not allowed with a " "An END tag is not allowed with a "
"REC= specifier at %L.", &dt->end_where); "REC= specifier at %L", &dt->end_where);
io_constraint (dt->format_label == &format_asterisk, io_constraint (dt->format_label == &format_asterisk,
"FMT=* is not allowed with a REC= specifier " "FMT=* is not allowed with a REC= specifier "
"at %L.", spec_end); "at %L", spec_end);
io_constraint (dt->pos,
"POS= is not allowed with REC= specifier "
"at %L", &dt->pos->where);
} }
if (dt->advance) if (dt->advance)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment