aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/io.c
diff options
context:
space:
mode:
authorPaul Thomas <pault@gcc.gnu.org>2005-08-14 16:15:40 +0000
committerPaul Thomas <pault@gcc.gnu.org>2005-08-14 16:15:40 +0000
commit7af8f00c543646474396940a162866e60bf350de (patch)
treeac2f22c51d35dc9fa5d7732e086d66a7d40f0e8e /gcc/fortran/io.c
parentadb7b76436a93a635cb93e72ec6e701f4b10d6f5 (diff)
downloadgcc-7af8f00c543646474396940a162866e60bf350de.zip
gcc-7af8f00c543646474396940a162866e60bf350de.tar.gz
gcc-7af8f00c543646474396940a162866e60bf350de.tar.bz2
re PR fortran/21432 (gfortran does not support printing of namelists)
2005-08-14 Paul Thomas <pault@gcc.gnu.org> PR fortran/21432. * io.c (match_io): Add code to implement PRINT namelist. 2005-08-14 Paul Thomas <pault@gcc.gnu.org> PR fortran/21432. * gfortran.dg/namelist_print_1.f: New test of functionality of PRINT namelist. * gfortran.dg/namelist_print_2.f: New test to check that PRINT namelist generates error with -std=f95. From-SVN: r103079
Diffstat (limited to 'gcc/fortran/io.c')
-rw-r--r--gcc/fortran/io.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/gcc/fortran/io.c b/gcc/fortran/io.c
index 78899aa..5b27ead 100644
--- a/gcc/fortran/io.c
+++ b/gcc/fortran/io.c
@@ -2133,6 +2133,30 @@ match_io (io_kind k)
if (gfc_match_char ('(') == MATCH_NO)
{
+ /* Treat the non-standard case of PRINT namelist. */
+ if (k == M_PRINT && (gfc_match_name (name) == MATCH_YES)
+ && !gfc_find_symbol (name, NULL, 1, &sym)
+ && (sym->attr.flavor == FL_NAMELIST))
+ {
+ if (gfc_notify_std (GFC_STD_GNU, "PRINT namelist at "
+ "%C is an extension") == FAILURE)
+ {
+ m = MATCH_ERROR;
+ goto cleanup;
+ }
+ if (gfc_match_eos () == MATCH_NO)
+ {
+ gfc_error ("Namelist followed by I/O list at %C");
+ m = MATCH_ERROR;
+ goto cleanup;
+ }
+
+ dt->io_unit = default_unit (k);
+ dt->namelist = sym;
+ goto get_io_list;
+ }
+
+
if (k == M_WRITE)
goto syntax;