]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR fortran/38439 (I/O PD edit descriptor inconsistency)
authorJerry DeLisle <jvdelisle@gcc.gnu.org>
Sun, 11 Oct 2009 17:41:23 +0000 (17:41 +0000)
committerJerry DeLisle <jvdelisle@gcc.gnu.org>
Sun, 11 Oct 2009 17:41:23 +0000 (17:41 +0000)
2009-10-11 Jerry DeLisle  <jvdelisle@gcc.gnu.org>

PR fortran/38439
* io.c (check_format): Fix locus for error messages and fix a comment.

From-SVN: r152645

gcc/fortran/ChangeLog
gcc/fortran/io.c

index 44c28dd7dc7b35137e97a769f58e7d9602f7fc9a..5082c0a8d722bcaa74296b091d7d3abb3658f4ca 100644 (file)
@@ -1,3 +1,8 @@
+2009-10-11 Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR fortran/38439
+       * io.c (check_format): Fix locus for error messages and fix a comment.
+
 2009-10-11  Paul Thomas  <pault@gcc.gnu.org>
 
        PR fortran/41583
index abd370f50481925a43ccfada50457bc1bf495f6f..d6b64c4120c9e55d40a13b2db91d65eff1d15099 100644 (file)
@@ -643,6 +643,8 @@ format_item_1:
 
     case FMT_X:
       /* X requires a prior number if we're being pedantic.  */
+      if (mode != MODE_FORMAT)
+       format_locus.nextc += format_string_pos;
       if (gfc_notify_std (GFC_STD_GNU, "Extension: X descriptor "
                          "requires leading space count at %L", &format_locus)
          == FAILURE)
@@ -722,7 +724,7 @@ data_desc:
       break;
 
     case FMT_P:
-      /* Comma after P is allowed only for F, E, EN, ES, D, or G.
+      /* No comma after P allowed only for F, E, EN, ES, D, or G.
         10.1.1 (1).  */
       t = format_lex ();
       if (t == FMT_ERROR)
@@ -1052,7 +1054,7 @@ between_desc:
 
     default:
       if (mode != MODE_FORMAT)
-       format_locus.nextc += format_string_pos;
+       format_locus.nextc += format_string_pos - 1;
       if (gfc_notify_std (GFC_STD_GNU, "Extension: Missing comma at %L",
          &format_locus) == FAILURE)
        return FAILURE;