+2008-04-06 Tobias Burnus <burnus@net-b.de>
+
+ * io.c (check_io_constraints): Add constrains. ID= requires
+ asynchronous= and asynchronous= must be init expression.
+
2008-04-06 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
* f95-lang.c: Set LANG_HOOKS_NAME to "GNU Fortran".
&dt->eor_where);
}
- if (dt->asynchronous && dt->asynchronous->expr_type == EXPR_CONSTANT)
+ if (dt->asynchronous)
{
static const char * asynchronous[] = { "YES", "NO", NULL };
+ if (dt->asynchronous->expr_type != EXPR_CONSTANT)
+ {
+ gfc_error ("ASYNCHRONOUS= specifier at %L must be an initialization "
+ "expression", &dt->asynchronous->where);
+ return MATCH_ERROR;
+ }
+
if (!compare_to_allowed_values
("ASYNCHRONOUS", asynchronous, NULL, NULL,
dt->asynchronous->value.character.string,
if (dt->id)
{
- io_constraint (dt->asynchronous
- && strcmp (dt->asynchronous->value.character.string,
+ io_constraint (!dt->asynchronous
+ || strcmp (dt->asynchronous->value.character.string,
"yes"),
"ID=specifier at %L must be with ASYNCHRONOUS='yes' "
"specifier", &dt->id->where);
+2008-04-06 Tobias Burnus <burnus@net-b.de>
+
+ * gfortran.dg/f2003_io_1.f03: Make standard conform.
+ * gfortran.dg/f2003_io_8.f03: New.
+
2008-04-06 Eric Botcazou <ebotcazou@adacore.com>
* gnat.dg/pack5.adb: New test.
b = 0.0
open(10, file='mydata', asynchronous="yes", blank="null")
-write(10,'(10f8.3)', decimal="comma", id=j) a
+write(10,'(10f8.3)', asynchronous="yes", decimal="comma", id=j) a
rewind(10)
read(10,'(10f8.3)', asynchronous="yes", decimal="comma", blank="zero") b
if (any(b.ne.23.45)) call abort
--- /dev/null
+! { dg-do compile }
+! { dg-options "-std=gnu" }
+!
+real :: a(4), b(4)
+real :: c
+integer :: istat, j
+character(25) :: msg
+
+open(10, file='mydata', asynchronous="yes", blank="null")
+write(10,'(10f8.3)', asynchronous='no', decimal="comma", id=j) a ! { dg-error "must be with ASYNCHRONOUS=" }
+read(10,'(10f8.3)', id=j, decimal="comma", blank="zero") b ! { dg-error "must be with ASYNCHRONOUS=" }
+read(10,'(10f8.3)', asynchronous=msg, decimal="comma", blank="zero") b ! { dg-error "must be an initialization expression" }
+end