This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
[gfortran] Fix PR 18023
- From: Tobias Schlüter <tobias dot schlueter at physik dot uni-muenchen dot de>
- To: GCC Fortran mailing list <fortran at gcc dot gnu dot org>,patch <gcc-patches at gcc dot gnu dot org>
- Date: Sat, 16 Oct 2004 18:29:02 +0200
- Subject: [gfortran] Fix PR 18023
We have some code in place to support assigned formats. I don't think this
actually works, but I haven't verified, as I didn't want to look up the
semantics of it, but the error in PR 18023 seems to say quite clearly that it
wouldn't work. Parts of this code canceled checking of the arguments passed to
a PRINT statement, so that the frontend would e.g. accept a statement of the
form "PRINT x", where x is a character variable.
This patch fixes this, testing in progress. I will also add a testcase to the
testsuite. Ok?
- Tobi
2004-10-16 Tobias Schlueter <tobias.schlueter@physik.uni-muenchen.de>
PR fortran/18023
* io.c (resolve_tag): Tighten up exception for assigned formats.
Index: io.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/fortran/io.c,v
retrieving revision 1.15
diff -u -p -r1.15 io.c
--- io.c 16 Sep 2004 16:00:42 -0000 1.15
+++ io.c 16 Oct 2004 16:18:15 -0000
@@ -968,10 +968,10 @@ resolve_tag (const io_tag * tag, gfc_exp
if (e->ts.type != tag->type)
{
/* Format label can be integer varibale. */
- if (tag != &tag_format)
+ if (tag != &tag_format || e->ts.type != BT_INTEGER)
{
gfc_error ("%s tag at %L must be of type %s", tag->name, &e->where,
- gfc_basic_typename (tag->type));
+ gfc_basic_typename (tag->type));
return FAILURE;
}
}