]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR fortran/24285 ([4.2 only] format(1000(a,$)))
authorFrancois-Xavier Coudert <coudert@clipper.ens.fr>
Sat, 18 Nov 2006 12:16:42 +0000 (13:16 +0100)
committerFrançois-Xavier Coudert <fxcoudert@gcc.gnu.org>
Sat, 18 Nov 2006 12:16:42 +0000 (12:16 +0000)
PR fortran/24285

* io.c (check_format): Allow dollars everywhere in format, and
issue a warning.

* gfortran.dg/dollar_edit_descriptor-3.f: New test.

From-SVN: r118971

gcc/fortran/ChangeLog
gcc/fortran/io.c
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/dollar_edit_descriptor-3.f [new file with mode: 0644]

index 281539573bb07338e7950bed737c45119a1c4852..dc4cab9aa5fccf56682f2221b20af27e3939fc54 100644 (file)
@@ -1,3 +1,9 @@
+2006-11-18  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
+
+       PR fortran/24285
+       * io.c (check_format): Allow dollars everywhere in format, and
+       issue a warning.
+
 2006-11-17  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
 
        * gfortran.h (gfc_add_intrinsic_modules_path,
index 24a92090f9e49a019a339da93fa5ae0b32157875..adf274ee118949ef301c87dc15c9f41fbc1c6e8d 100644 (file)
@@ -510,8 +510,8 @@ format_item_1:
         return FAILURE;
       if (t != FMT_RPAREN || level > 0)
        {
-         error = _("$ must be the last specifier");
-         goto syntax;
+         gfc_warning ("$ should be the last specifier in format at %C");
+         goto optional_comma_1;
        }
 
       goto finished;
@@ -755,8 +755,9 @@ between_desc:
 
 optional_comma:
   /* Optional comma is a weird between state where we've just finished
-     reading a colon, slash or P descriptor.  */
+     reading a colon, slash, dollar or P descriptor.  */
   t = format_lex ();
+optional_comma_1:
   switch (t)
     {
     case FMT_COMMA:
index 02089e5e012bc5225b3b1e8e756ba286a64c8b42..2eff1c87b7e77fcb482a09880735e0cfe1b7090e 100644 (file)
@@ -1,5 +1,9 @@
-2006-11-17  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
+2006-11-18  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
+
+       PR fortran/24285
+       * gfortran.dg/dollar_edit_descriptor-3.f: New test.
 
+2006-11-17  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
        * gfortran.dg/use_1.f90: New test.
        * gfortran.dg/use_1.f90: New test.
        * gfortran.dg/use_1.f90: New test.
diff --git a/gcc/testsuite/gfortran.dg/dollar_edit_descriptor-3.f b/gcc/testsuite/gfortran.dg/dollar_edit_descriptor-3.f
new file mode 100644 (file)
index 0000000..6e5bf68
--- /dev/null
@@ -0,0 +1,8 @@
+! { dg-do run }
+! { dg-options "-std=gnu" }
+! Test for dollar descriptor in the middle of a format
+300   format(1000(a,$)) ! { dg-warning "should be the last specifier" }
+      write(*,300) "gee", "gee"
+      write(*,"(1000(a,$))") "foo", "bar" ! { dg-warning "should be the last specifier" }
+      end
+! { dg-output "^geegeefoobar$" }