aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran
diff options
context:
space:
mode:
authorTobias Burnus <burnus@net-b.de>2008-04-06 17:38:33 +0200
committerTobias Burnus <burnus@gcc.gnu.org>2008-04-06 17:38:33 +0200
commitfbe88ffa1600321d5d83d0aa4797192665822289 (patch)
tree5d9316399c02854d9363b957e9feb4a84931a3a6 /gcc/fortran
parent2d091b12a0466d34d78d696bed390f3792ffe9fa (diff)
downloadgcc-fbe88ffa1600321d5d83d0aa4797192665822289.zip
gcc-fbe88ffa1600321d5d83d0aa4797192665822289.tar.gz
gcc-fbe88ffa1600321d5d83d0aa4797192665822289.tar.bz2
io.c (check_io_constraints): Add constrains.
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 Tobias Burnus <burnus@net-b.de> * gfortran.dg/f2003_io_1.f03: Make standard conform. * gfortran.dg/f2003_io_8.f03: New. From-SVN: r133962
Diffstat (limited to 'gcc/fortran')
-rw-r--r--gcc/fortran/ChangeLog5
-rw-r--r--gcc/fortran/io.c13
2 files changed, 15 insertions, 3 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index d7cfedb..49c8a0c 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,8 @@
+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".
diff --git a/gcc/fortran/io.c b/gcc/fortran/io.c
index 917acc3..034039f 100644
--- a/gcc/fortran/io.c
+++ b/gcc/fortran/io.c
@@ -2866,10 +2866,17 @@ if (condition) \
&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,
@@ -2879,8 +2886,8 @@ if (condition) \
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);