re PR libfortran/20006 ($ format extension doesn't work)
authorFrancois-Xavier Coudert <coudert@clipper.ens.fr>
Sun, 29 May 2005 12:22:49 +0000 (14:22 +0200)
committerFrançois-Xavier Coudert <fxcoudert@gcc.gnu.org>
Sun, 29 May 2005 12:22:49 +0000 (12:22 +0000)
PR libfortran/20006
* io.c (format_item_1): Add check and extension warning for
$ edit descriptor.
* io/format.c (parse_format_list): Set repeat count of $ format
node to 1.
* io/transfer.c (read_sf): Add g.seen_dollar to the test
concerning advancing I/O.
(data_transfer_init): Likewise.
(finalize_transfer): Likewise.

From-SVN: r100314

gcc/fortran/ChangeLog
gcc/fortran/io.c
libgfortran/ChangeLog
libgfortran/io/format.c
libgfortran/io/transfer.c

index 097ef92350f17dfa7b52f585b0ad142c94f8ae3d..b10aea28ee1cf28214ca683b99847b2083f81b06 100644 (file)
@@ -1,3 +1,9 @@
+2005-05-29  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
+
+       PR libfortran/20006
+       * io.c (format_item_1): Add check and extension warning for
+       $ edit descriptor.
+
 2005-05-28  Steven G. Kargl  <kargls@comcast.net>
 
        * arith.c (gfc_arith_init_1): Fix off by one problem;
index 8dab5f59afd8c67f4bdceee8afcf4393b9bb63a4..5fae9a2d09429c5016ec8536cdb7b111fcb94dc6 100644 (file)
@@ -491,9 +491,13 @@ format_item_1:
 
     case FMT_DOLLAR:
       t = format_lex ();
+
+      if (gfc_notify_std (GFC_STD_GNU, "Extension: $ descriptor at %C")
+          == FAILURE)
+        return FAILURE;
       if (t != FMT_RPAREN || level > 0)
        {
-         error = "$ must the last specifier";
+         error = "$ must be the last specifier";
          goto syntax;
        }
 
index f3bb715819518005cee11a71302f85d6af3b2e14..e816c31c70d0b1eb19990bd3f4a620fac49b2683 100644 (file)
@@ -1,3 +1,13 @@
+2005-05-29  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
+
+       PR libfortran/20006
+       * io/format.c (parse_format_list): Set repeat count of $ format
+       node to 1.
+       * io/transfer.c (read_sf): Add g.seen_dollar to the test
+       concerning advancing I/O.
+       (data_transfer_init): Likewise.
+       (finalize_transfer): Likewise.
+       
 2005-05-27  Thomas Koenig  <Thomas.Koenig@online.de>
 
        * runtime/in_pack_generic.c:  Adjust copyright years.
index 413a664542d3415dfe4eeba430d5e1dc530a922a..229a937b05bfacc869d39b44e9ad352aff914b06 100644 (file)
@@ -579,6 +579,7 @@ parse_format_list (void)
 
     case FMT_DOLLAR:
       get_fnode (&head, &tail, FMT_DOLLAR);
+      tail->repeat = 1;
       goto between_desc;
 
     case FMT_T:
index b51da52204ee4c938939b679bd6b2a8f50030814..46bec834a274f68d7f6268df9c955e6658370dce 100644 (file)
@@ -191,7 +191,7 @@ read_sf (int *length)
 
          /* If we see an EOR during non-advancing I/O, we need to skip
             the rest of the I/O statement.  Set the corresponding flag.  */
-         if (advance_status == ADVANCE_NO)
+         if (advance_status == ADVANCE_NO || g.seen_dollar)
            eor_condition = 1;
 
          /* Without padding, terminate the I/O statement without assigning
@@ -1187,7 +1187,7 @@ data_transfer_init (int read_flag)
     }
   else
     {
-      if (advance_status == ADVANCE_YES)
+      if (advance_status == ADVANCE_YES && !g.seen_dollar)
        current_unit->read_bad = 1;
     }
 
@@ -1459,11 +1459,12 @@ finalize_transfer (void)
     {
       free_fnodes ();
 
-      if (advance_status == ADVANCE_NO)
+      if (advance_status == ADVANCE_NO || g.seen_dollar)
        {
          /* Most systems buffer lines, so force the partial record
             to be written out.  */
          flush (current_unit->s);
+         g.seen_dollar = 0;
          return;
        }