public inbox for fortran@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] PR fortran/89103 - Allow blank format items in format strings
@ 2019-05-23  8:19 Mark Eggleston
  2019-06-03 11:57 ` *ping* " Mark Eggleston
  0 siblings, 1 reply; 17+ messages in thread
From: Mark Eggleston @ 2019-05-23  8:19 UTC (permalink / raw)
  To: fortran, gcc-patches

[-- Attachment #1: Type: text/plain, Size: 1150 bytes --]

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89103 see comment 4

Please can some one commit the attached patch for me as I do not have 
the privileges to do so.

Change logs:

gcc/fortran

     Jim MacArthur  <jim.macarthur@codethink.co.uk>
     Mark Eggleston  <mark.eggleston@codethink.com>
     PR fortran/89103
     * gfortran.texi: Add -fdec-blank-format-item
     * invoke.texi: Add to section on Commas in FORMAT specifications.
     * io.c (check_format): At FMT_RPAREN goto finished if
     -fdec-blank-format-item.
     * lang.opt: Add new option.
     * options.c (set_dec_flags): Add SET_BITFLAG for
     flag_dec_format_defaults.

gcc/testsuite

     Jim MacArthur <jim.macarthur@codethink.co.uk>
     Mark Eggleston <mark.eggleston@codethink.com>

     PR fortran/89103
     * gfortran.dg/dec_format_empty_item_1.f: New test.
     * gfortran.dg/dec_format_empty_item_2.f: New test.
     * gfortran.dg/dec_format_empty_item_3.f: New test.

-- 
https://www.codethink.co.uk/privacy.html


[-- Attachment #2: 0006-Allow-blank-format-items-in-format-strings.patch --]
[-- Type: text/x-patch, Size: 7764 bytes --]

From f04143dd423d2eda2ce206e42ae914374b273f82 Mon Sep 17 00:00:00 2001
From: Jim MacArthur <jim.macarthur@codethink.co.uk>
Date: Thu, 4 Feb 2016 16:59:41 +0000
Subject: [PATCH 1/5] Allow blank format items in format strings

This has to be written in a slightly verbose manner because GCC 7
defaults to building with -Werror=implicit-fallthrough which prevents
us from just falling through to the default: case.

Test written by: Francisco Redondo Marchena <francisco.marchena@codethink.co.uk>

Use -fdec-blank-format-item to enable. Also enabled by -fdec.
---
 gcc/fortran/gfortran.texi                           |  7 ++++++-
 gcc/fortran/invoke.texi                             | 13 +++++++++----
 gcc/fortran/io.c                                    | 10 ++++++++++
 gcc/fortran/lang.opt                                |  4 ++++
 gcc/fortran/options.c                               |  1 +
 gcc/testsuite/gfortran.dg/dec_format_empty_item_1.f | 19 +++++++++++++++++++
 gcc/testsuite/gfortran.dg/dec_format_empty_item_2.f | 19 +++++++++++++++++++
 gcc/testsuite/gfortran.dg/dec_format_empty_item_3.f | 19 +++++++++++++++++++
 8 files changed, 87 insertions(+), 5 deletions(-)
 create mode 100644 gcc/testsuite/gfortran.dg/dec_format_empty_item_1.f
 create mode 100644 gcc/testsuite/gfortran.dg/dec_format_empty_item_2.f
 create mode 100644 gcc/testsuite/gfortran.dg/dec_format_empty_item_3.f

diff --git a/gcc/fortran/gfortran.texi b/gcc/fortran/gfortran.texi
index 0e6c57142cd..2d53202dd71 100644
--- a/gcc/fortran/gfortran.texi
+++ b/gcc/fortran/gfortran.texi
@@ -1761,11 +1761,16 @@ When omitted, the count is implicitly assumed to be one.
 
 To support legacy codes, GNU Fortran allows the comma separator
 to be omitted immediately before and after character string edit
-descriptors in @code{FORMAT} statements.
+descriptors in @code{FORMAT} statements.  A comma with no following format
+decriptor is permited if the @option{-fdec-blank-format-item} is given on
+the command line. This is considered non-conforming code and is
+discouraged.
 
 @smallexample
        PRINT 10, 2, 3
 10     FORMAT ('FOO='I1' BAR='I2)
+       print 20, 5, 6
+20     FORMAT (I3, I3,)
 @end smallexample
 
 
diff --git a/gcc/fortran/invoke.texi b/gcc/fortran/invoke.texi
index 63fce66a593..80804993522 100644
--- a/gcc/fortran/invoke.texi
+++ b/gcc/fortran/invoke.texi
@@ -119,10 +119,10 @@ by type.  Explanations are in the following sections.
 @gccoptlist{-fall-intrinsics -fbackslash -fcray-pointer -fd-lines-as-code @gol
 -fd-lines-as-comments -fdec -fdec-structure -fdec-intrinsic-ints @gol
 -fdec-static -fdec-math -fdec-include -fdec-format-defaults @gol
--fdefault-double-8 -fdefault-integer-8 -fdefault-real-8 -fdefault-real-10 @gol
--fdefault-real-16 -fdollar-ok -ffixed-line-length-@var{n} @gol
--ffixed-line-length-none -fpad-source -ffree-form @gol
--ffree-line-length-@var{n} -ffree-line-length-none @gol
+-fdec-blank-format-item -fdefault-double-8 -fdefault-integer-8 @gol
+-fdefault-real-8 -fdefault-real-10 -fdefault-real-16 -fdollar-ok @gol
+-ffixed-line-length-@var{n} -ffixed-line-length-none -fpad-source @gol
+-ffree-form -ffree-line-length-@var{n} -ffree-line-length-none @gol
 -fimplicit-none -finteger-4-integer-8 -fmax-identifier-length @gol
 -fmodule-private -ffixed-form -fno-range-check -fopenacc -fopenmp @gol
 -freal-4-real-10 -freal-4-real-16 -freal-4-real-8 -freal-8-real-10 @gol
@@ -288,6 +288,11 @@ be on a single line and can use line continuations.
 Enable format specifiers F, G and I to be used without width specifiers,
 default widths will be used instead.
 
+@item -fdec-blank-format-item
+@opindex @code{fdec-blank-format-item}
+Enable a blank format item at the end of a format specification i.e. nothing
+following the final comma.
+
 @item -fdollar-ok
 @opindex @code{fdollar-ok}
 @cindex @code{$}
diff --git a/gcc/fortran/io.c b/gcc/fortran/io.c
index 80a0d7402d2..4d0de65be1a 100644
--- a/gcc/fortran/io.c
+++ b/gcc/fortran/io.c
@@ -756,6 +756,16 @@ format_item_1:
       error = unexpected_end;
       goto syntax;
 
+    case FMT_RPAREN:
+      /* Oracle allows a blank format item. */
+      if (flag_dec_blank_format_item)
+	goto finished;
+      else
+	{
+	  error = unexpected_element;
+	  goto syntax;
+	}
+
     default:
       error = unexpected_element;
       goto syntax;
diff --git a/gcc/fortran/lang.opt b/gcc/fortran/lang.opt
index 26e82601b62..cc2eae238b9 100644
--- a/gcc/fortran/lang.opt
+++ b/gcc/fortran/lang.opt
@@ -440,6 +440,10 @@ fdec
 Fortran Var(flag_dec)
 Enable all DEC language extensions.
 
+fdec-blank-format-item
+Fortran Var(flag_dec_blank_format_item)
+Enable the use of blank format items in format strings.
+
 fdec-include
 Fortran Var(flag_dec_include)
 Enable legacy parsing of INCLUDE as statement.
diff --git a/gcc/fortran/options.c b/gcc/fortran/options.c
index 9ba48dc8439..e32aa441822 100644
--- a/gcc/fortran/options.c
+++ b/gcc/fortran/options.c
@@ -75,6 +75,7 @@ set_dec_flags (int value)
   SET_BITFLAG (flag_dec_math, value, value);
   SET_BITFLAG (flag_dec_include, value, value);
   SET_BITFLAG (flag_dec_format_defaults, value, value);
+  SET_BITFLAG (flag_dec_blank_format_item, value, value);
 }
 
 /* Finalize DEC flags.  */
diff --git a/gcc/testsuite/gfortran.dg/dec_format_empty_item_1.f b/gcc/testsuite/gfortran.dg/dec_format_empty_item_1.f
new file mode 100644
index 00000000000..ed27c18944b
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/dec_format_empty_item_1.f
@@ -0,0 +1,19 @@
+! { dg-do run }
+! { dg-options "-fdec" }
+!
+! Test blank/empty format items in format string
+!
+! Test case contributed by Jim MacArthur <jim.macarthur@codethink.co.uk>
+! Modified by Mark Eggleston <mark.eggleston@codethink.com>
+!
+        PROGRAM blank_format_items
+          INTEGER A/0/
+
+          OPEN(1, status="scratch")
+          WRITE(1, 10) 100
+          REWIND(1)
+          READ(1, 10) A
+          IF (a.NE.100) STOP 1
+          PRINT 10, A
+10        FORMAT( I5,)
+        END
diff --git a/gcc/testsuite/gfortran.dg/dec_format_empty_item_2.f b/gcc/testsuite/gfortran.dg/dec_format_empty_item_2.f
new file mode 100644
index 00000000000..2793cb16225
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/dec_format_empty_item_2.f
@@ -0,0 +1,19 @@
+! { dg-do run }
+! { dg-options "-fdec-blank-format-item" }
+!
+! Test blank/empty format items in format string
+!
+! Test case contributed by Jim MacArthur <jim.macarthur@codethink.co.uk>
+! Modified by Mark Eggleston <mark.eggleston@codethink.com>
+!
+        PROGRAM blank_format_items
+          INTEGER A/0/
+
+          OPEN(1, status="scratch")
+          WRITE(1, 10) 100
+          REWIND(1)
+          READ(1, 10) A
+          IF (a.NE.100) STOP 1
+          PRINT 10, A
+10        FORMAT( I5,)
+        END
diff --git a/gcc/testsuite/gfortran.dg/dec_format_empty_item_3.f b/gcc/testsuite/gfortran.dg/dec_format_empty_item_3.f
new file mode 100644
index 00000000000..499db922876
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/dec_format_empty_item_3.f
@@ -0,0 +1,19 @@
+! { dg-do compile }
+! { dg-options "-fdec -fno-dec-blank-format-item" }
+!
+! Test blank/empty format items in format string
+!
+! Test case contributed by Jim MacArthur <jim.macarthur@codethink.co.uk>
+! Modified by Mark Eggleston <mark.eggleston@codethink.com>
+!
+        PROGRAM blank_format_items
+          INTEGER A/0/
+
+          OPEN(1, status="scratch")
+          WRITE(1, 10) 100 ! { dg-error "FORMAT label 10 at \\(1\\) not defined" }
+          REWIND(1)
+          READ(1, 10) A ! { dg-error "FORMAT label 10 at \\(1\\) not defined" }
+          IF (a.NE.100) STOP 1
+          PRINT 10, A ! { dg-error "FORMAT label 10 at \\(1\\) not defined" }
+10        FORMAT( I5,) ! { dg-error "Unexpected element" }
+        END
-- 
2.11.0


^ permalink raw reply	[flat|nested] 17+ messages in thread

* *ping* Re: [PATCH] PR fortran/89103 - Allow blank format items in format strings
  2019-05-23  8:19 [PATCH] PR fortran/89103 - Allow blank format items in format strings Mark Eggleston
@ 2019-06-03 11:57 ` Mark Eggleston
  2019-06-05  0:54   ` Jerry DeLisle
  0 siblings, 1 reply; 17+ messages in thread
From: Mark Eggleston @ 2019-06-03 11:57 UTC (permalink / raw)
  To: fortran

*ping*

On 23/05/2019 09:19, Mark Eggleston wrote:
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89103 see comment 4
>
> Please can some one commit the attached patch for me as I do not have 
> the privileges to do so.
>
> Change logs:
>
> gcc/fortran
>
>     Jim MacArthur  <jim.macarthur@codethink.co.uk>
>     Mark Eggleston  <mark.eggleston@codethink.com>
>     PR fortran/89103
>     * gfortran.texi: Add -fdec-blank-format-item
>     * invoke.texi: Add to section on Commas in FORMAT specifications.
>     * io.c (check_format): At FMT_RPAREN goto finished if
>     -fdec-blank-format-item.
>     * lang.opt: Add new option.
>     * options.c (set_dec_flags): Add SET_BITFLAG for
>     flag_dec_format_defaults.
>
> gcc/testsuite
>
>     Jim MacArthur <jim.macarthur@codethink.co.uk>
>     Mark Eggleston <mark.eggleston@codethink.com>
>
>     PR fortran/89103
>     * gfortran.dg/dec_format_empty_item_1.f: New test.
>     * gfortran.dg/dec_format_empty_item_2.f: New test.
>     * gfortran.dg/dec_format_empty_item_3.f: New test.
>
-- 
https://www.codethink.co.uk/privacy.html

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: *ping* Re: [PATCH] PR fortran/89103 - Allow blank format items in format strings
  2019-06-03 11:57 ` *ping* " Mark Eggleston
@ 2019-06-05  0:54   ` Jerry DeLisle
  2019-06-07 14:34     ` Jerry DeLisle
  0 siblings, 1 reply; 17+ messages in thread
From: Jerry DeLisle @ 2019-06-05  0:54 UTC (permalink / raw)
  To: Mark Eggleston, fortran

On 6/3/19 4:57 AM, Mark Eggleston wrote:
> *ping*
> 
> On 23/05/2019 09:19, Mark Eggleston wrote:
>> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89103 see comment 4
>>
>> Please can some one commit the attached patch for me as I do not have the 
>> privileges to do so.
>>

Mark,

Give me a few days to review the patch, apply it, and test and I will take care 
of it unless someone objects. (I have been out of the loop for a bit, silently 
present in the lurking dungeons. ;) )

Jerry

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: *ping* Re: [PATCH] PR fortran/89103 - Allow blank format items in format strings
  2019-06-05  0:54   ` Jerry DeLisle
@ 2019-06-07 14:34     ` Jerry DeLisle
  2019-06-10  9:37       ` Mark Eggleston
  0 siblings, 1 reply; 17+ messages in thread
From: Jerry DeLisle @ 2019-06-07 14:34 UTC (permalink / raw)
  To: Mark Eggleston, fortran

On 6/4/19 5:54 PM, Jerry DeLisle wrote:
> On 6/3/19 4:57 AM, Mark Eggleston wrote:
>> *ping*
>>
>> On 23/05/2019 09:19, Mark Eggleston wrote:
>>> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89103 see comment 4
>>>
>>> Please can some one commit the attached patch for me as I do not have the 
>>> privileges to do so.
>>>
> 
> Mark,
> 
> Give me a few days to review the patch, apply it, and test and I will take care 
> of it unless someone objects. (I have been out of the loop for a bit, silently 
> present in the lurking dungeons. ;) )
> 
> Jerry
> 

Committing to svn+ssh://jvdelisle@gcc.gnu.org/svn/gcc/trunk ...
	M	gcc/testsuite/ChangeLog
	M	gcc/testsuite/gfortran.dg/fmt_f_default_field_width_3.f90
	M	gcc/testsuite/gfortran.dg/fmt_g_default_field_width_3.f90
Committed r272046

Regards,

Jerry

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: *ping* Re: [PATCH] PR fortran/89103 - Allow blank format items in format strings
  2019-06-07 14:34     ` Jerry DeLisle
@ 2019-06-10  9:37       ` Mark Eggleston
  2019-06-10 10:30         ` Thomas Koenig
  0 siblings, 1 reply; 17+ messages in thread
From: Mark Eggleston @ 2019-06-10  9:37 UTC (permalink / raw)
  To: Jerry DeLisle, fortran

[-- Attachment #1: Type: text/plain, Size: 2050 bytes --]


On 07/06/2019 15:33, Jerry DeLisle wrote:
> On 6/4/19 5:54 PM, Jerry DeLisle wrote:
>> On 6/3/19 4:57 AM, Mark Eggleston wrote:
>>> *ping*
>>>
>>> On 23/05/2019 09:19, Mark Eggleston wrote:
>>>> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89103 see comment 4
>>>>
>>>> Please can some one commit the attached patch for me as I do not 
>>>> have the privileges to do so.
>>>>
>>
>> Mark,
>>
>> Give me a few days to review the patch, apply it, and test and I will 
>> take care of it unless someone objects. (I have been out of the loop 
>> for a bit, silently present in the lurking dungeons. ;) )
>>
>> Jerry
>>
>
> Committing to svn+ssh://jvdelisle@gcc.gnu.org/svn/gcc/trunk ...
>     M    gcc/testsuite/ChangeLog
>     M    gcc/testsuite/gfortran.dg/fmt_f_default_field_width_3.f90
>     M    gcc/testsuite/gfortran.dg/fmt_g_default_field_width_3.f90
> Committed r272046

Thanks, that was for PR fortran/89100 to fix its test cases. PR 
fortran/89103 also needs doing which I have attached.

gcc/fortran

     Jim MacArthur <jim.macarthur@codethink.co.uk>
     Mark Eggleston <mark.eggleston@codethink.com>
     PR fortran/89103
     * gfortran.texi: Add -fdec-blank-format-item
     * invoke.texi: Add to section on Commas in FORMAT specifications.
     * io.c (check_format): At FMT_RPAREN goto finished if
     -fdec-blank-format-item.
     * lang.opt: Add new option.
     * options.c (set_dec_flags): Add SET_BITFLAG for
     flag_dec_format_defaults.

gcc/testsuite

     Jim MacArthur <jim.macarthur@codethink.co.uk>
     Mark Eggleston <mark.eggleston@codethink.com>

     PR fortran/89103
     * gfortran.dg/dec_format_empty_item_1.f: New test.
     * gfortran.dg/dec_format_empty_item_2.f: New test.
     * gfortran.dg/dec_format_empty_item_3.f: New test.

>
> Regards,
>
> Jerry
>
-- 
https://www.codethink.co.uk/privacy.html


[-- Attachment #2: 0006-Allow-blank-format-items-in-format-strings.patch --]
[-- Type: text/x-patch, Size: 7764 bytes --]

From f04143dd423d2eda2ce206e42ae914374b273f82 Mon Sep 17 00:00:00 2001
From: Jim MacArthur <jim.macarthur@codethink.co.uk>
Date: Thu, 4 Feb 2016 16:59:41 +0000
Subject: [PATCH 1/5] Allow blank format items in format strings

This has to be written in a slightly verbose manner because GCC 7
defaults to building with -Werror=implicit-fallthrough which prevents
us from just falling through to the default: case.

Test written by: Francisco Redondo Marchena <francisco.marchena@codethink.co.uk>

Use -fdec-blank-format-item to enable. Also enabled by -fdec.
---
 gcc/fortran/gfortran.texi                           |  7 ++++++-
 gcc/fortran/invoke.texi                             | 13 +++++++++----
 gcc/fortran/io.c                                    | 10 ++++++++++
 gcc/fortran/lang.opt                                |  4 ++++
 gcc/fortran/options.c                               |  1 +
 gcc/testsuite/gfortran.dg/dec_format_empty_item_1.f | 19 +++++++++++++++++++
 gcc/testsuite/gfortran.dg/dec_format_empty_item_2.f | 19 +++++++++++++++++++
 gcc/testsuite/gfortran.dg/dec_format_empty_item_3.f | 19 +++++++++++++++++++
 8 files changed, 87 insertions(+), 5 deletions(-)
 create mode 100644 gcc/testsuite/gfortran.dg/dec_format_empty_item_1.f
 create mode 100644 gcc/testsuite/gfortran.dg/dec_format_empty_item_2.f
 create mode 100644 gcc/testsuite/gfortran.dg/dec_format_empty_item_3.f

diff --git a/gcc/fortran/gfortran.texi b/gcc/fortran/gfortran.texi
index 0e6c57142cd..2d53202dd71 100644
--- a/gcc/fortran/gfortran.texi
+++ b/gcc/fortran/gfortran.texi
@@ -1761,11 +1761,16 @@ When omitted, the count is implicitly assumed to be one.
 
 To support legacy codes, GNU Fortran allows the comma separator
 to be omitted immediately before and after character string edit
-descriptors in @code{FORMAT} statements.
+descriptors in @code{FORMAT} statements.  A comma with no following format
+decriptor is permited if the @option{-fdec-blank-format-item} is given on
+the command line. This is considered non-conforming code and is
+discouraged.
 
 @smallexample
        PRINT 10, 2, 3
 10     FORMAT ('FOO='I1' BAR='I2)
+       print 20, 5, 6
+20     FORMAT (I3, I3,)
 @end smallexample
 
 
diff --git a/gcc/fortran/invoke.texi b/gcc/fortran/invoke.texi
index 63fce66a593..80804993522 100644
--- a/gcc/fortran/invoke.texi
+++ b/gcc/fortran/invoke.texi
@@ -119,10 +119,10 @@ by type.  Explanations are in the following sections.
 @gccoptlist{-fall-intrinsics -fbackslash -fcray-pointer -fd-lines-as-code @gol
 -fd-lines-as-comments -fdec -fdec-structure -fdec-intrinsic-ints @gol
 -fdec-static -fdec-math -fdec-include -fdec-format-defaults @gol
--fdefault-double-8 -fdefault-integer-8 -fdefault-real-8 -fdefault-real-10 @gol
--fdefault-real-16 -fdollar-ok -ffixed-line-length-@var{n} @gol
--ffixed-line-length-none -fpad-source -ffree-form @gol
--ffree-line-length-@var{n} -ffree-line-length-none @gol
+-fdec-blank-format-item -fdefault-double-8 -fdefault-integer-8 @gol
+-fdefault-real-8 -fdefault-real-10 -fdefault-real-16 -fdollar-ok @gol
+-ffixed-line-length-@var{n} -ffixed-line-length-none -fpad-source @gol
+-ffree-form -ffree-line-length-@var{n} -ffree-line-length-none @gol
 -fimplicit-none -finteger-4-integer-8 -fmax-identifier-length @gol
 -fmodule-private -ffixed-form -fno-range-check -fopenacc -fopenmp @gol
 -freal-4-real-10 -freal-4-real-16 -freal-4-real-8 -freal-8-real-10 @gol
@@ -288,6 +288,11 @@ be on a single line and can use line continuations.
 Enable format specifiers F, G and I to be used without width specifiers,
 default widths will be used instead.
 
+@item -fdec-blank-format-item
+@opindex @code{fdec-blank-format-item}
+Enable a blank format item at the end of a format specification i.e. nothing
+following the final comma.
+
 @item -fdollar-ok
 @opindex @code{fdollar-ok}
 @cindex @code{$}
diff --git a/gcc/fortran/io.c b/gcc/fortran/io.c
index 80a0d7402d2..4d0de65be1a 100644
--- a/gcc/fortran/io.c
+++ b/gcc/fortran/io.c
@@ -756,6 +756,16 @@ format_item_1:
       error = unexpected_end;
       goto syntax;
 
+    case FMT_RPAREN:
+      /* Oracle allows a blank format item. */
+      if (flag_dec_blank_format_item)
+	goto finished;
+      else
+	{
+	  error = unexpected_element;
+	  goto syntax;
+	}
+
     default:
       error = unexpected_element;
       goto syntax;
diff --git a/gcc/fortran/lang.opt b/gcc/fortran/lang.opt
index 26e82601b62..cc2eae238b9 100644
--- a/gcc/fortran/lang.opt
+++ b/gcc/fortran/lang.opt
@@ -440,6 +440,10 @@ fdec
 Fortran Var(flag_dec)
 Enable all DEC language extensions.
 
+fdec-blank-format-item
+Fortran Var(flag_dec_blank_format_item)
+Enable the use of blank format items in format strings.
+
 fdec-include
 Fortran Var(flag_dec_include)
 Enable legacy parsing of INCLUDE as statement.
diff --git a/gcc/fortran/options.c b/gcc/fortran/options.c
index 9ba48dc8439..e32aa441822 100644
--- a/gcc/fortran/options.c
+++ b/gcc/fortran/options.c
@@ -75,6 +75,7 @@ set_dec_flags (int value)
   SET_BITFLAG (flag_dec_math, value, value);
   SET_BITFLAG (flag_dec_include, value, value);
   SET_BITFLAG (flag_dec_format_defaults, value, value);
+  SET_BITFLAG (flag_dec_blank_format_item, value, value);
 }
 
 /* Finalize DEC flags.  */
diff --git a/gcc/testsuite/gfortran.dg/dec_format_empty_item_1.f b/gcc/testsuite/gfortran.dg/dec_format_empty_item_1.f
new file mode 100644
index 00000000000..ed27c18944b
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/dec_format_empty_item_1.f
@@ -0,0 +1,19 @@
+! { dg-do run }
+! { dg-options "-fdec" }
+!
+! Test blank/empty format items in format string
+!
+! Test case contributed by Jim MacArthur <jim.macarthur@codethink.co.uk>
+! Modified by Mark Eggleston <mark.eggleston@codethink.com>
+!
+        PROGRAM blank_format_items
+          INTEGER A/0/
+
+          OPEN(1, status="scratch")
+          WRITE(1, 10) 100
+          REWIND(1)
+          READ(1, 10) A
+          IF (a.NE.100) STOP 1
+          PRINT 10, A
+10        FORMAT( I5,)
+        END
diff --git a/gcc/testsuite/gfortran.dg/dec_format_empty_item_2.f b/gcc/testsuite/gfortran.dg/dec_format_empty_item_2.f
new file mode 100644
index 00000000000..2793cb16225
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/dec_format_empty_item_2.f
@@ -0,0 +1,19 @@
+! { dg-do run }
+! { dg-options "-fdec-blank-format-item" }
+!
+! Test blank/empty format items in format string
+!
+! Test case contributed by Jim MacArthur <jim.macarthur@codethink.co.uk>
+! Modified by Mark Eggleston <mark.eggleston@codethink.com>
+!
+        PROGRAM blank_format_items
+          INTEGER A/0/
+
+          OPEN(1, status="scratch")
+          WRITE(1, 10) 100
+          REWIND(1)
+          READ(1, 10) A
+          IF (a.NE.100) STOP 1
+          PRINT 10, A
+10        FORMAT( I5,)
+        END
diff --git a/gcc/testsuite/gfortran.dg/dec_format_empty_item_3.f b/gcc/testsuite/gfortran.dg/dec_format_empty_item_3.f
new file mode 100644
index 00000000000..499db922876
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/dec_format_empty_item_3.f
@@ -0,0 +1,19 @@
+! { dg-do compile }
+! { dg-options "-fdec -fno-dec-blank-format-item" }
+!
+! Test blank/empty format items in format string
+!
+! Test case contributed by Jim MacArthur <jim.macarthur@codethink.co.uk>
+! Modified by Mark Eggleston <mark.eggleston@codethink.com>
+!
+        PROGRAM blank_format_items
+          INTEGER A/0/
+
+          OPEN(1, status="scratch")
+          WRITE(1, 10) 100 ! { dg-error "FORMAT label 10 at \\(1\\) not defined" }
+          REWIND(1)
+          READ(1, 10) A ! { dg-error "FORMAT label 10 at \\(1\\) not defined" }
+          IF (a.NE.100) STOP 1
+          PRINT 10, A ! { dg-error "FORMAT label 10 at \\(1\\) not defined" }
+10        FORMAT( I5,) ! { dg-error "Unexpected element" }
+        END
-- 
2.11.0


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: *ping* Re: [PATCH] PR fortran/89103 - Allow blank format items in format strings
  2019-06-10  9:37       ` Mark Eggleston
@ 2019-06-10 10:30         ` Thomas Koenig
  2019-06-10 13:33           ` Mark Eggleston
  0 siblings, 1 reply; 17+ messages in thread
From: Thomas Koenig @ 2019-06-10 10:30 UTC (permalink / raw)
  To: Mark Eggleston, Jerry DeLisle, fortran

Hi Mark,

> +++ b/gcc/fortran/io.c
> @@ -756,6 +756,16 @@ format_item_1:
>         error = unexpected_end;
>         goto syntax;
>   
> +    case FMT_RPAREN:
> +      /* Oracle allows a blank format item. */
> +      if (flag_dec_blank_format_item)
> +	goto finished;
> +      else
> +	{
> +	  error = unexpected_element;
> +	  goto syntax;
> +	}
> +

If we make an extra effort to support this non-standard code, we
could at least use this to generate a more informative error message
(which could also point to the option that would allow this extension).

Regards

	Thomas

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: *ping* Re: [PATCH] PR fortran/89103 - Allow blank format items in format strings
  2019-06-10 10:30         ` Thomas Koenig
@ 2019-06-10 13:33           ` Mark Eggleston
  2019-06-10 14:08             ` Thomas Koenig
  0 siblings, 1 reply; 17+ messages in thread
From: Mark Eggleston @ 2019-06-10 13:33 UTC (permalink / raw)
  To: Thomas Koenig, Jerry DeLisle, fortran


On 10/06/2019 11:30, Thomas Koenig wrote:
> Hi Mark,
>
>> +++ b/gcc/fortran/io.c
>> @@ -756,6 +756,16 @@ format_item_1:
>>         error = unexpected_end;
>>         goto syntax;
>>   +    case FMT_RPAREN:
>> +      /* Oracle allows a blank format item. */
>> +      if (flag_dec_blank_format_item)
>> +    goto finished;
>> +      else
>> +    {
>> +      error = unexpected_element;
>> +      goto syntax;
>> +    }
>> +
>
> If we make an extra effort to support this non-standard code, we
> could at least use this to generate a more informative error message
> (which could also point to the option that would allow this extension).

This patch is for a customer that has a huge codebase and that is the 
only reason for its existence. The error message has not changed. Making 
it more informative, indicating an option that will allow this 
non-standard usage, is a bad idea as it could result in its spread. As 
is the case with all legacy features and extensions their inclusion 
risks pollution of Fortran code with non-standard features which is why 
they should only be available using explicit compiler options.

>
> Regards
>
>     Thomas
>
-- 
https://www.codethink.co.uk/privacy.html

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: *ping* Re: [PATCH] PR fortran/89103 - Allow blank format items in format strings
  2019-06-10 13:33           ` Mark Eggleston
@ 2019-06-10 14:08             ` Thomas Koenig
  2019-06-10 14:10               ` Mark Eggleston
  0 siblings, 1 reply; 17+ messages in thread
From: Thomas Koenig @ 2019-06-10 14:08 UTC (permalink / raw)
  To: Mark Eggleston, Jerry DeLisle, fortran

Am 10.06.19 um 15:33 schrieb Mark Eggleston:
> This patch is for a customer that has a huge codebase and that is the 
> only reason for its existence.

I didn't know gfortran as a whole has customers as such :-)

> The error message has not changed. Making 
> it more informative, indicating an option that will allow this 
> non-standard usage, is a bad idea as it could result in its spread.

OK, I understand that. So scrap the idea of pointing towards the
option.

However, making it more informative _without_ pointing towards that
option is still a good idea (such as "missing item in format list").

If we want to allow legacy extensions to clutter our code, getting
a more informative error message is something we can get in return,
at least.

Regards

	Thomas

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: *ping* Re: [PATCH] PR fortran/89103 - Allow blank format items in format strings
  2019-06-10 14:08             ` Thomas Koenig
@ 2019-06-10 14:10               ` Mark Eggleston
  2019-06-11  9:31                 ` Mark Eggleston
  0 siblings, 1 reply; 17+ messages in thread
From: Mark Eggleston @ 2019-06-10 14:10 UTC (permalink / raw)
  To: fortran


On 10/06/2019 15:07, Thomas Koenig wrote:
> Am 10.06.19 um 15:33 schrieb Mark Eggleston:
>> This patch is for a customer that has a huge codebase and that is the 
>> only reason for its existence.
>
> I didn't know gfortran as a whole has customers as such :-)
>
>> The error message has not changed. Making it more informative, 
>> indicating an option that will allow this non-standard usage, is a 
>> bad idea as it could result in its spread.
>
> OK, I understand that. So scrap the idea of pointing towards the
> option.
>
> However, making it more informative _without_ pointing towards that
> option is still a good idea (such as "missing item in format list").
That's a much better idea. I'll implement that and when it's ready I'll 
update the patch.
>
> If we want to allow legacy extensions to clutter our code, getting
> a more informative error message is something we can get in return,
> at least.
>
> Regards
>
>     Thomas
>
-- 
https://www.codethink.co.uk/privacy.html

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: *ping* Re: [PATCH] PR fortran/89103 - Allow blank format items in format strings
  2019-06-10 14:10               ` Mark Eggleston
@ 2019-06-11  9:31                 ` Mark Eggleston
  2019-06-11  9:50                   ` Jakub Jelinek
  0 siblings, 1 reply; 17+ messages in thread
From: Mark Eggleston @ 2019-06-11  9:31 UTC (permalink / raw)
  To: Thomas Koenig, Jerry DeLisle, fortran, gcc-patches

[-- Attachment #1: Type: text/plain, Size: 2195 bytes --]


On 10/06/2019 15:10, Mark Eggleston wrote:
>
> On 10/06/2019 15:07, Thomas Koenig wrote:
>> Am 10.06.19 um 15:33 schrieb Mark Eggleston:
>>> This patch is for a customer that has a huge codebase and that is 
>>> the only reason for its existence.
>>
>> I didn't know gfortran as a whole has customers as such :-)
>>
>>> The error message has not changed. Making it more informative, 
>>> indicating an option that will allow this non-standard usage, is a 
>>> bad idea as it could result in its spread.
>>
>> OK, I understand that. So scrap the idea of pointing towards the
>> option.
>>
>> However, making it more informative _without_ pointing towards that
>> option is still a good idea (such as "missing item in format list").
> That's a much better idea. I'll implement that and when it's ready 
> I'll update the patch.

Patch updated and attached. ChangeLogs:

gcc/fortran

     Jim MacArthur  <jim.macarthur@codethink.co.uk>
     Mark Eggleston  <mark.eggleston@codethink.com>

     PR fortran/89103
     * gfortran.texi: Add -fdec-blank-format-item
     * invoke.texi: Add to section on Commas in FORMAT specifications.
     * io.c (check_format): Add new string missing_item.
     * io.c (check_format): At FMT_RPAREN goto finished if
     -fdec-blank-format-item otherwise set error string to missing_item.
     * lang.opt: Add new option.
     * options.c (set_dec_flags): Add SET_BITFLAG for
     flag_dec_format_defaults.

     Jim MacArthur <jim.macarthur@codethink.co.uk>
     Mark Eggleston <mark.eggleston@codethink.com>

gcc/testsuite

     PR fortran/89103
     * gfortran.dg/dec_format_empty_item_1.f: New test.
     * gfortran.dg/dec_format_empty_item_2.f: New test.
     * gfortran.dg/dec_format_empty_item_3.f: New test.

If OK, please can someone commit this.

>>
>> If we want to allow legacy extensions to clutter our code, getting
>> a more informative error message is something we can get in return,
>> at least.
>>
>> Regards
>>
>>     Thomas
>>
-- 
https://www.codethink.co.uk/privacy.html


[-- Attachment #2: 0006-Allow-blank-format-items-in-format-strings.patch --]
[-- Type: text/x-patch, Size: 8106 bytes --]

From 5a78d94a626444d4f71bcda99c5fc6ebb0509f46 Mon Sep 17 00:00:00 2001
From: Jim MacArthur <jim.macarthur@codethink.co.uk>
Date: Thu, 4 Feb 2016 16:59:41 +0000
Subject: [PATCH 01/10] Allow blank format items in format strings

This has to be written in a slightly verbose manner because GCC 7
defaults to building with -Werror=implicit-fallthrough which prevents
us from just falling through to the default: case.

Test written by: Francisco Redondo Marchena <francisco.marchena@codethink.co.uk>

Use -fdec-blank-format-item to enable. Also enabled by -fdec.
---
 gcc/fortran/gfortran.texi                           |  7 ++++++-
 gcc/fortran/invoke.texi                             | 13 +++++++++----
 gcc/fortran/io.c                                    | 11 +++++++++++
 gcc/fortran/lang.opt                                |  4 ++++
 gcc/fortran/options.c                               |  1 +
 gcc/testsuite/gfortran.dg/dec_format_empty_item_1.f | 19 +++++++++++++++++++
 gcc/testsuite/gfortran.dg/dec_format_empty_item_2.f | 19 +++++++++++++++++++
 gcc/testsuite/gfortran.dg/dec_format_empty_item_3.f | 19 +++++++++++++++++++
 8 files changed, 88 insertions(+), 5 deletions(-)
 create mode 100644 gcc/testsuite/gfortran.dg/dec_format_empty_item_1.f
 create mode 100644 gcc/testsuite/gfortran.dg/dec_format_empty_item_2.f
 create mode 100644 gcc/testsuite/gfortran.dg/dec_format_empty_item_3.f

diff --git a/gcc/fortran/gfortran.texi b/gcc/fortran/gfortran.texi
index 57461e0e42f..c887e7d1a42 100644
--- a/gcc/fortran/gfortran.texi
+++ b/gcc/fortran/gfortran.texi
@@ -1761,11 +1761,16 @@ When omitted, the count is implicitly assumed to be one.
 
 To support legacy codes, GNU Fortran allows the comma separator
 to be omitted immediately before and after character string edit
-descriptors in @code{FORMAT} statements.
+descriptors in @code{FORMAT} statements.  A comma with no following format
+decriptor is permited if the @option{-fdec-blank-format-item} is given on
+the command line. This is considered non-conforming code and is
+discouraged.
 
 @smallexample
        PRINT 10, 2, 3
 10     FORMAT ('FOO='I1' BAR='I2)
+       print 20, 5, 6
+20     FORMAT (I3, I3,)
 @end smallexample
 
 
diff --git a/gcc/fortran/invoke.texi b/gcc/fortran/invoke.texi
index 2e2cb5b2728..2b08ac4de22 100644
--- a/gcc/fortran/invoke.texi
+++ b/gcc/fortran/invoke.texi
@@ -119,10 +119,10 @@ by type.  Explanations are in the following sections.
 @gccoptlist{-fall-intrinsics -fbackslash -fcray-pointer -fd-lines-as-code @gol
 -fd-lines-as-comments -fdec -fdec-structure -fdec-intrinsic-ints @gol
 -fdec-static -fdec-math -fdec-include -fdec-format-defaults @gol
--fdefault-double-8 -fdefault-integer-8 -fdefault-real-8 -fdefault-real-10 @gol
--fdefault-real-16 -fdollar-ok -ffixed-line-length-@var{n} @gol
--ffixed-line-length-none -fpad-source -ffree-form @gol
--ffree-line-length-@var{n} -ffree-line-length-none @gol
+-fdec-blank-format-item -fdefault-double-8 -fdefault-integer-8 @gol
+-fdefault-real-8 -fdefault-real-10 -fdefault-real-16 -fdollar-ok @gol
+-ffixed-line-length-@var{n} -ffixed-line-length-none -fpad-source @gol
+-ffree-form -ffree-line-length-@var{n} -ffree-line-length-none @gol
 -fimplicit-none -finteger-4-integer-8 -fmax-identifier-length @gol
 -fmodule-private -ffixed-form -fno-range-check -fopenacc -fopenmp @gol
 -freal-4-real-10 -freal-4-real-16 -freal-4-real-8 -freal-8-real-10 @gol
@@ -289,6 +289,11 @@ be on a single line and can use line continuations.
 Enable format specifiers F, G and I to be used without width specifiers,
 default widths will be used instead.
 
+@item -fdec-blank-format-item
+@opindex @code{fdec-blank-format-item}
+Enable a blank format item at the end of a format specification i.e. nothing
+following the final comma.
+
 @item -fdollar-ok
 @opindex @code{fdollar-ok}
 @cindex @code{$}
diff --git a/gcc/fortran/io.c b/gcc/fortran/io.c
index 57117579627..9821c3c6c34 100644
--- a/gcc/fortran/io.c
+++ b/gcc/fortran/io.c
@@ -598,6 +598,7 @@ check_format (bool is_input)
 {
   const char *posint_required	  = _("Positive width required");
   const char *nonneg_required	  = _("Nonnegative width required");
+  const char *missing_item	  = _("Missing item");
   const char *unexpected_element  = _("Unexpected element %qc in format "
 				      "string at %L");
   const char *unexpected_end	  = _("Unexpected end of format string");
@@ -756,6 +757,16 @@ format_item_1:
       error = unexpected_end;
       goto syntax;
 
+    case FMT_RPAREN:
+      /* Oracle allows a blank format item. */
+      if (flag_dec_blank_format_item)
+	goto finished;
+      else
+	{
+	  error = missing_item;
+	  goto syntax;
+	}
+
     default:
       error = unexpected_element;
       goto syntax;
diff --git a/gcc/fortran/lang.opt b/gcc/fortran/lang.opt
index 93ea3d3977b..88674cb5dc7 100644
--- a/gcc/fortran/lang.opt
+++ b/gcc/fortran/lang.opt
@@ -444,6 +444,10 @@ fdec
 Fortran Var(flag_dec)
 Enable all DEC language extensions.
 
+fdec-blank-format-item
+Fortran Var(flag_dec_blank_format_item)
+Enable the use of blank format items in format strings.
+
 fdec-include
 Fortran Var(flag_dec_include)
 Enable legacy parsing of INCLUDE as statement.
diff --git a/gcc/fortran/options.c b/gcc/fortran/options.c
index 4f91486e977..3bc79ef9b45 100644
--- a/gcc/fortran/options.c
+++ b/gcc/fortran/options.c
@@ -75,6 +75,7 @@ set_dec_flags (int value)
   SET_BITFLAG (flag_dec_math, value, value);
   SET_BITFLAG (flag_dec_include, value, value);
   SET_BITFLAG (flag_dec_format_defaults, value, value);
+  SET_BITFLAG (flag_dec_blank_format_item, value, value);
 }
 
 /* Finalize DEC flags.  */
diff --git a/gcc/testsuite/gfortran.dg/dec_format_empty_item_1.f b/gcc/testsuite/gfortran.dg/dec_format_empty_item_1.f
new file mode 100644
index 00000000000..ed27c18944b
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/dec_format_empty_item_1.f
@@ -0,0 +1,19 @@
+! { dg-do run }
+! { dg-options "-fdec" }
+!
+! Test blank/empty format items in format string
+!
+! Test case contributed by Jim MacArthur <jim.macarthur@codethink.co.uk>
+! Modified by Mark Eggleston <mark.eggleston@codethink.com>
+!
+        PROGRAM blank_format_items
+          INTEGER A/0/
+
+          OPEN(1, status="scratch")
+          WRITE(1, 10) 100
+          REWIND(1)
+          READ(1, 10) A
+          IF (a.NE.100) STOP 1
+          PRINT 10, A
+10        FORMAT( I5,)
+        END
diff --git a/gcc/testsuite/gfortran.dg/dec_format_empty_item_2.f b/gcc/testsuite/gfortran.dg/dec_format_empty_item_2.f
new file mode 100644
index 00000000000..2793cb16225
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/dec_format_empty_item_2.f
@@ -0,0 +1,19 @@
+! { dg-do run }
+! { dg-options "-fdec-blank-format-item" }
+!
+! Test blank/empty format items in format string
+!
+! Test case contributed by Jim MacArthur <jim.macarthur@codethink.co.uk>
+! Modified by Mark Eggleston <mark.eggleston@codethink.com>
+!
+        PROGRAM blank_format_items
+          INTEGER A/0/
+
+          OPEN(1, status="scratch")
+          WRITE(1, 10) 100
+          REWIND(1)
+          READ(1, 10) A
+          IF (a.NE.100) STOP 1
+          PRINT 10, A
+10        FORMAT( I5,)
+        END
diff --git a/gcc/testsuite/gfortran.dg/dec_format_empty_item_3.f b/gcc/testsuite/gfortran.dg/dec_format_empty_item_3.f
new file mode 100644
index 00000000000..dbccd671bae
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/dec_format_empty_item_3.f
@@ -0,0 +1,19 @@
+! { dg-do compile }
+! { dg-options "-fdec -fno-dec-blank-format-item" }
+!
+! Test blank/empty format items in format string
+!
+! Test case contributed by Jim MacArthur <jim.macarthur@codethink.co.uk>
+! Modified by Mark Eggleston <mark.eggleston@codethink.com>
+!
+        PROGRAM blank_format_items
+          INTEGER A/0/
+
+          OPEN(1, status="scratch")
+          WRITE(1, 10) 100 ! { dg-error "FORMAT label 10 at" }
+          REWIND(1)
+          READ(1, 10) A ! { dg-error "FORMAT label 10 at" }
+          IF (a.NE.100) STOP 1
+          PRINT 10, A ! { dg-error "FORMAT label 10 at" }
+ 10       FORMAT( I5,) ! { dg-error "Missing item" }
+        END
-- 
2.11.0


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: *ping* Re: [PATCH] PR fortran/89103 - Allow blank format items in format strings
  2019-06-11  9:31                 ` Mark Eggleston
@ 2019-06-11  9:50                   ` Jakub Jelinek
  2019-06-11 10:49                     ` [PATCH] check_format fixes Jakub Jelinek
  2019-06-12 18:11                     ` *ping* Re: [PATCH] PR fortran/89103 - Allow blank format items in format strings Steve Kargl
  0 siblings, 2 replies; 17+ messages in thread
From: Jakub Jelinek @ 2019-06-11  9:50 UTC (permalink / raw)
  To: Mark Eggleston; +Cc: Thomas Koenig, Jerry DeLisle, fortran, gcc-patches

On Tue, Jun 11, 2019 at 10:30:59AM +0100, Mark Eggleston wrote:
>     Jim MacArthur <jim.macarthur@codethink.co.uk>
>     Mark Eggleston <mark.eggleston@codethink.com>

Two spaces before < instead of one.

This is not a patch review, just comments:

> This has to be written in a slightly verbose manner because GCC 7
> defaults to building with -Werror=implicit-fallthrough which prevents
> us from just falling through to the default: case.

That is not true, one can fall through just fine, just there needs to be a
comment or attribute or builtin that says so.

> --- a/gcc/fortran/io.c
> +++ b/gcc/fortran/io.c
> @@ -598,6 +598,7 @@ check_format (bool is_input)
>  {
>    const char *posint_required	  = _("Positive width required");
>    const char *nonneg_required	  = _("Nonnegative width required");
> +  const char *missing_item	  = _("Missing item");
>    const char *unexpected_element  = _("Unexpected element %qc in format "
>  				      "string at %L");
>    const char *unexpected_end	  = _("Unexpected end of format string");
> @@ -756,6 +757,16 @@ format_item_1:
>        error = unexpected_end;
>        goto syntax;
>  
> +    case FMT_RPAREN:
> +      /* Oracle allows a blank format item. */
> +      if (flag_dec_blank_format_item)
> +	goto finished;
> +      else
> +	{
> +	  error = missing_item;
> +	  goto syntax;
> +	}

So, if you want to fall thru, just do:
    case FMT_RPAREN:
      if (flag_dec_blank_format_item)
	goto finished;
      /* FALLTHRU */

> +
>      default:
>        error = unexpected_element;
>        goto syntax;

and that is it.  Not sure I'd mention the Oracle fortran compiler there,
either it is common to other DEC based compilers too (DEC fortran, ifort,
...) and then the comment makes no sense, or it might not be best to call
the flag -fdec-whatever.

Furthermore, even if you want to have a _("Missing item"), you should write
it as error = _("Missing item");, not the way it is written, as that way it
is inefficient at compile time.

The rest is just a general comment on the preexisting code.
Using a bunch of const char *whatever = _("...");
at the start of function is undesirable, it means any time this function is
called, even in the likely case there is no error, all those strings need to
be translated.  It would be better to e.g. replace all _("...") in that
function with G_("...") (i.e. mark for translation, but don't translate),
and only when actually using that translate:
  if (error == unexpected_element)
    gfc_error (error, error_element, &format_locus);
  else
    gfc_error ("%s in format string at %L", error, &format_locus);
The first case is translated already by gfc_error, the second one would need
_(error) instead of error (but is generally wrong anyway, because you are
constructing a diagnostics from two pieces which might not be ok for
translations.  So, likely you want to append " in format string at %L" to
all the error string literals inside of G_("...") and just pass error as
first argument to gfc_error.

	Jakub

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [PATCH] check_format fixes
  2019-06-11  9:50                   ` Jakub Jelinek
@ 2019-06-11 10:49                     ` Jakub Jelinek
  2019-06-12  7:24                       ` Jakub Jelinek
  2019-06-12 18:11                     ` *ping* Re: [PATCH] PR fortran/89103 - Allow blank format items in format strings Steve Kargl
  1 sibling, 1 reply; 17+ messages in thread
From: Jakub Jelinek @ 2019-06-11 10:49 UTC (permalink / raw)
  To: fortran, gcc-patches; +Cc: Mark Eggleston

On Tue, Jun 11, 2019 at 11:50:40AM +0200, Jakub Jelinek wrote:
> The rest is just a general comment on the preexisting code.
> Using a bunch of const char *whatever = _("...");
> at the start of function is undesirable, it means any time this function is
> called, even in the likely case there is no error, all those strings need to
> be translated.  It would be better to e.g. replace all _("...") in that
> function with G_("...") (i.e. mark for translation, but don't translate),
> and only when actually using that translate:
>   if (error == unexpected_element)
>     gfc_error (error, error_element, &format_locus);
>   else
>     gfc_error ("%s in format string at %L", error, &format_locus);
> The first case is translated already by gfc_error, the second one would need
> _(error) instead of error (but is generally wrong anyway, because you are
> constructing a diagnostics from two pieces which might not be ok for
> translations.  So, likely you want to append " in format string at %L" to
> all the error string literals inside of G_("...") and just pass error as
> first argument to gfc_error.

It is actually even worse.  On:
      write (10, 100)
      write (10, 200)
100   format (*)
200   format (DT(124:))
      end
gfortran reports:
Error: Left parenthesis required after %<*%> in format string at (1)
and
Error: Right parenthesis expected at %C in format string at (1)
With the following patch which implements the above (but not the -fdec*
addition Mark has been posting), it reports:
Error: Left parenthesis required after ‘*’ in format string at (1)
and
Error: Right parenthesis expected at (1) in format string at (2)
instead.

Tested on x86_64-linux with check-gfortran, ok for trunk if full bootstrap/regtest
passes?

2019-06-11  Jakub Jelinek  <jakub@redhat.com>

	* io.c (check_format): Use G_(...) instead of _(...) for error values,
	append " in format string at %L" to all strings but unexpected_element,
	use error as gfc_error formating string instead of
	"%s in format string at %L".  Formatting fixes.

--- gcc/fortran/io.c.jj	2019-05-23 12:57:17.762475649 +0200
+++ gcc/fortran/io.c	2019-06-11 12:24:23.155712025 +0200
@@ -596,12 +596,16 @@ token_to_string (format_token t)
 static bool
 check_format (bool is_input)
 {
-  const char *posint_required	  = _("Positive width required");
-  const char *nonneg_required	  = _("Nonnegative width required");
-  const char *unexpected_element  = _("Unexpected element %qc in format "
-				      "string at %L");
-  const char *unexpected_end	  = _("Unexpected end of format string");
-  const char *zero_width	  = _("Zero width in format descriptor");
+  const char *posint_required
+    = G_("Positive width required in format string at %L");
+  const char *nonneg_required
+    = G_("Nonnegative width required in format string at %L");
+  const char *unexpected_element 
+    = G_("Unexpected element %qc in format string at %L");
+  const char *unexpected_end
+    = G_("Unexpected end of format string in format string at %L");
+  const char *zero_width
+    = G_("Zero width in format descriptor in format string at %L");
 
   const char *error = NULL;
   format_token t, u;
@@ -621,7 +625,7 @@ check_format (bool is_input)
     goto fail;
   if (t != FMT_LPAREN)
     {
-      error = _("Missing leading left parenthesis");
+      error = G_("Missing leading left parenthesis in format string at %L");
       goto syntax;
     }
 
@@ -650,7 +654,8 @@ format_item_1:
 	  level++;
 	  goto format_item;
 	}
-      error = _("Left parenthesis required after %<*%>");
+      error = G_("Left parenthesis required after %<*%> in format string "
+		 "at %L");
       goto syntax;
 
     case FMT_POSINT:
@@ -681,7 +686,7 @@ format_item_1:
 	goto fail;
       if (t != FMT_P)
 	{
-	  error = _("Expected P edit descriptor");
+	  error = G_("Expected P edit descriptor in format string at %L");
 	  goto syntax;
 	}
 
@@ -689,7 +694,8 @@ format_item_1:
 
     case FMT_P:
       /* P requires a prior number.  */
-      error = _("P descriptor requires leading scale factor");
+      error = G_("P descriptor requires leading scale factor in format "
+		 "string at %L");
       goto syntax;
 
     case FMT_X:
@@ -783,7 +789,8 @@ data_desc:
 	  && t != FMT_F && t != FMT_E && t != FMT_EN && t != FMT_ES
 	  && t != FMT_D && t != FMT_G && t != FMT_RPAREN && t != FMT_SLASH)
 	{
-	  error = _("Comma required after P descriptor");
+	  error = G_("Comma required after P descriptor in format string "
+		     "at %L");
 	  goto syntax;
 	}
       if (t != FMT_COMMA)
@@ -794,10 +801,11 @@ data_desc:
 	      if (t == FMT_ERROR)
 		goto fail;
 	    }
-          if (t != FMT_F && t != FMT_E && t != FMT_EN && t != FMT_ES && t != FMT_D
-	      && t != FMT_G && t != FMT_RPAREN && t != FMT_SLASH)
+	  if (t != FMT_F && t != FMT_E && t != FMT_EN && t != FMT_ES
+	      && t != FMT_D && t != FMT_G && t != FMT_RPAREN && t != FMT_SLASH)
 	    {
-	      error = _("Comma required after P descriptor");
+	      error = G_("Comma required after P descriptor in format string "
+			 "at %L");
 	      goto syntax;
 	    }
 	}
@@ -811,7 +819,8 @@ data_desc:
       t = format_lex ();
       if (t != FMT_POSINT)
 	{
-	  error = _("Positive width required with T descriptor");
+	  error = G_("Positive width required with T descriptor in format "
+		     "string at %L");
 	  goto syntax;
 	}
       break;
@@ -894,7 +903,8 @@ data_desc:
 	  u = format_lex ();
 	  if (u == FMT_E)
 	    {
-	      error = _("E specifier not allowed with g0 descriptor");
+	      error = G_("E specifier not allowed with g0 descriptor in "
+			 "format string at %L");
 	      goto syntax;
 	    }
 	  saved_token = u;
@@ -961,9 +971,7 @@ data_desc:
       if (u == FMT_ERROR)
 	goto fail;
       if (u != FMT_E)
-	{
-	  saved_token = u;
-	}
+	saved_token = u;
       else
 	{
 	  u = format_lex ();
@@ -971,7 +979,8 @@ data_desc:
 	    goto fail;
 	  if (u != FMT_POSINT)
 	    {
-	      error = _("Positive exponent width required");
+	      error = G_("Positive exponent width required in format string "
+			 "at %L");
 	      goto syntax;
 	    }
 	}
@@ -1017,7 +1026,8 @@ data_desc:
 	    goto dtio_vlist;
 	  if (t != FMT_RPAREN)
 	    {
-	      error = _("Right parenthesis expected at %C");
+	      error = G_("Right parenthesis expected at %C in format string "
+			 "at %L");
 	      goto syntax;
 	    }
 	  goto between_desc;
@@ -1058,7 +1068,8 @@ data_desc:
 	  /* Warn if -std=legacy, otherwise error.  */
 	  if (gfc_option.warn_std != 0)
 	    {
-	      error = _("Period required in format specifier");
+	      error = G_("Period required in format specifier in format "
+			 "string at %L");
 	      goto syntax;
 	    }
 	  if (mode != MODE_FORMAT)
@@ -1132,9 +1143,7 @@ data_desc:
       if (t == FMT_ERROR)
 	goto fail;
       if (t != FMT_PERIOD)
-	{
-	  saved_token = t;
-	}
+	saved_token = t;
       else
 	{
 	  t = format_lex ();
@@ -1262,7 +1271,7 @@ syntax:
   if (error == unexpected_element)
     gfc_error (error, error_element, &format_locus);
   else
-    gfc_error ("%s in format string at %L", error, &format_locus);
+    gfc_error (error, &format_locus);
 fail:
   rv = false;
 


	Jakub

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH] check_format fixes
  2019-06-11 10:49                     ` [PATCH] check_format fixes Jakub Jelinek
@ 2019-06-12  7:24                       ` Jakub Jelinek
  2019-06-12 18:07                         ` Steve Kargl
  0 siblings, 1 reply; 17+ messages in thread
From: Jakub Jelinek @ 2019-06-12  7:24 UTC (permalink / raw)
  To: fortran, gcc-patches; +Cc: Mark Eggleston

On Tue, Jun 11, 2019 at 12:49:32PM +0200, Jakub Jelinek wrote:
> Tested on x86_64-linux with check-gfortran, ok for trunk if full bootstrap/regtest
> passes?
> 
> 2019-06-11  Jakub Jelinek  <jakub@redhat.com>
> 
> 	* io.c (check_format): Use G_(...) instead of _(...) for error values,
> 	append " in format string at %L" to all strings but unexpected_element,
> 	use error as gfc_error formating string instead of
> 	"%s in format string at %L".  Formatting fixes.

FYI, bootstrapped/regtested successfully on x86_64-linux and i686-linux.

	Jakub

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH] check_format fixes
  2019-06-12  7:24                       ` Jakub Jelinek
@ 2019-06-12 18:07                         ` Steve Kargl
  0 siblings, 0 replies; 17+ messages in thread
From: Steve Kargl @ 2019-06-12 18:07 UTC (permalink / raw)
  To: Jakub Jelinek; +Cc: fortran, gcc-patches, Mark Eggleston

On Wed, Jun 12, 2019 at 09:24:39AM +0200, Jakub Jelinek wrote:
> On Tue, Jun 11, 2019 at 12:49:32PM +0200, Jakub Jelinek wrote:
> > Tested on x86_64-linux with check-gfortran, ok for trunk if full bootstrap/regtest
> > passes?
> > 
> > 2019-06-11  Jakub Jelinek  <jakub@redhat.com>
> > 
> > 	* io.c (check_format): Use G_(...) instead of _(...) for error values,
> > 	append " in format string at %L" to all strings but unexpected_element,
> > 	use error as gfc_error formating string instead of
> > 	"%s in format string at %L".  Formatting fixes.
> 
> FYI, bootstrapped/regtested successfully on x86_64-linux and i686-linux.
> 

OK.

-- 
Steve

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: *ping* Re: [PATCH] PR fortran/89103 - Allow blank format items in format strings
  2019-06-11  9:50                   ` Jakub Jelinek
  2019-06-11 10:49                     ` [PATCH] check_format fixes Jakub Jelinek
@ 2019-06-12 18:11                     ` Steve Kargl
  2019-06-17 13:37                       ` Mark Eggleston
  1 sibling, 1 reply; 17+ messages in thread
From: Steve Kargl @ 2019-06-12 18:11 UTC (permalink / raw)
  To: Jakub Jelinek
  Cc: Mark Eggleston, Thomas Koenig, Jerry DeLisle, fortran, gcc-patches

On Tue, Jun 11, 2019 at 11:50:40AM +0200, Jakub Jelinek wrote:
> On Tue, Jun 11, 2019 at 10:30:59AM +0100, Mark Eggleston wrote:
> >     Jim MacArthur <jim.macarthur@codethink.co.uk>
> >     Mark Eggleston <mark.eggleston@codethink.com>
> 
> Two spaces before < instead of one.
> 
> This is not a patch review, just comments:

Mark, do you plan to address any of Jakub's comments.
Do note, I just 'OK' Jakub's patch that uses G_()
forms for the strings.

Also, do you have plans to contribute additional
patches (either for -fdec* extensions or preferrably
to help with bug fixes and new features)?  It may be
advantageous for you to get a commit bit.

-- 
Steve

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: *ping* Re: [PATCH] PR fortran/89103 - Allow blank format items in format strings
  2019-06-12 18:11                     ` *ping* Re: [PATCH] PR fortran/89103 - Allow blank format items in format strings Steve Kargl
@ 2019-06-17 13:37                       ` Mark Eggleston
  2019-06-19  1:39                         ` Jerry DeLisle
  0 siblings, 1 reply; 17+ messages in thread
From: Mark Eggleston @ 2019-06-17 13:37 UTC (permalink / raw)
  To: sgk, Jakub Jelinek; +Cc: Thomas Koenig, Jerry DeLisle, fortran, gcc-patches

[-- Attachment #1: Type: text/plain, Size: 2120 bytes --]


On 12/06/2019 19:11, Steve Kargl wrote:
> On Tue, Jun 11, 2019 at 11:50:40AM +0200, Jakub Jelinek wrote:
>> On Tue, Jun 11, 2019 at 10:30:59AM +0100, Mark Eggleston wrote:
>>>      Jim MacArthur <jim.macarthur@codethink.co.uk>
>>>      Mark Eggleston <mark.eggleston@codethink.com>
>> Two spaces before < instead of one.
>>
>> This is not a patch review, just comments:
> Mark, do you plan to address any of Jakub's comments.
> Do note, I just 'OK' Jakub's patch that uses G_()
> forms for the strings.

Now that Jakubs's patch has been committed, please find attached an 
updated patch and updated change logs:

gcc/fortran

     Jim MacArthur  <jim.macarthur@codethink.co.uk>
     Mark Eggleston  <mark.eggleston@codethink.com>

     PR fortran/89103
     * gfortran.texi: Add -fdec-blank-format-item
     * invoke.texi: Add option to list of options.
     * invoke.texi: Add to section on Commas in FORMAT specifications.
     * io.c (check_format): At FMT_RPAREN goto finished if
     -fdec-blank-format-item otherwise set error string.
     * lang.opt: Add new option.
     * options.c (set_dec_flags): Add SET_BITFLAG for
     flag_dec_format_defaults.

gcc/testsuite

     Jim MacArthur  <jim.macarthur@codethink.co.uk>
     Mark Eggleston  <mark.eggleston@codethink.com>

     PR fortran/89103
     * gfortran.dg/dec_format_empty_item_1.f: New test.
     * gfortran.dg/dec_format_empty_item_2.f: New test.
     * gfortran.dg/dec_format_empty_item_3.f: New test.

as before... Please can someone commit this as do not have commit rights.

>
> Also, do you have plans to contribute additional
> patches (either for -fdec* extensions or preferrably
> to help with bug fixes and new features)?  It may be
> advantageous for you to get a commit bit.
Yes, I do intend to contribute additional patches, mostly -fdec- 
patches, there are also some patches unrelated to -fdec* extensions.


-- 
https://www.codethink.co.uk/privacy.html


[-- Attachment #2: 0006-Allow-blank-format-items-in-format-strings.patch --]
[-- Type: text/x-patch, Size: 7404 bytes --]

From 48c734966d0f5d9f618b532d12b24fe784679dea Mon Sep 17 00:00:00 2001
From: Jim MacArthur <jim.macarthur@codethink.co.uk>
Date: Thu, 4 Feb 2016 16:59:41 +0000
Subject: [PATCH 01/10] Allow blank format items in format strings

Use -fdec-blank-format-item to enable. Also enabled by -fdec.
---
 gcc/fortran/gfortran.texi                           |  7 ++++++-
 gcc/fortran/invoke.texi                             | 13 +++++++++----
 gcc/fortran/io.c                                    |  9 +++++++++
 gcc/fortran/lang.opt                                |  4 ++++
 gcc/fortran/options.c                               |  1 +
 gcc/testsuite/gfortran.dg/dec_format_empty_item_1.f | 19 +++++++++++++++++++
 gcc/testsuite/gfortran.dg/dec_format_empty_item_2.f | 19 +++++++++++++++++++
 gcc/testsuite/gfortran.dg/dec_format_empty_item_3.f | 19 +++++++++++++++++++
 8 files changed, 86 insertions(+), 5 deletions(-)
 create mode 100644 gcc/testsuite/gfortran.dg/dec_format_empty_item_1.f
 create mode 100644 gcc/testsuite/gfortran.dg/dec_format_empty_item_2.f
 create mode 100644 gcc/testsuite/gfortran.dg/dec_format_empty_item_3.f

diff --git a/gcc/fortran/gfortran.texi b/gcc/fortran/gfortran.texi
index 57461e0e42f..c887e7d1a42 100644
--- a/gcc/fortran/gfortran.texi
+++ b/gcc/fortran/gfortran.texi
@@ -1761,11 +1761,16 @@ When omitted, the count is implicitly assumed to be one.
 
 To support legacy codes, GNU Fortran allows the comma separator
 to be omitted immediately before and after character string edit
-descriptors in @code{FORMAT} statements.
+descriptors in @code{FORMAT} statements.  A comma with no following format
+decriptor is permited if the @option{-fdec-blank-format-item} is given on
+the command line. This is considered non-conforming code and is
+discouraged.
 
 @smallexample
        PRINT 10, 2, 3
 10     FORMAT ('FOO='I1' BAR='I2)
+       print 20, 5, 6
+20     FORMAT (I3, I3,)
 @end smallexample
 
 
diff --git a/gcc/fortran/invoke.texi b/gcc/fortran/invoke.texi
index 2e2cb5b2728..2b08ac4de22 100644
--- a/gcc/fortran/invoke.texi
+++ b/gcc/fortran/invoke.texi
@@ -119,10 +119,10 @@ by type.  Explanations are in the following sections.
 @gccoptlist{-fall-intrinsics -fbackslash -fcray-pointer -fd-lines-as-code @gol
 -fd-lines-as-comments -fdec -fdec-structure -fdec-intrinsic-ints @gol
 -fdec-static -fdec-math -fdec-include -fdec-format-defaults @gol
--fdefault-double-8 -fdefault-integer-8 -fdefault-real-8 -fdefault-real-10 @gol
--fdefault-real-16 -fdollar-ok -ffixed-line-length-@var{n} @gol
--ffixed-line-length-none -fpad-source -ffree-form @gol
--ffree-line-length-@var{n} -ffree-line-length-none @gol
+-fdec-blank-format-item -fdefault-double-8 -fdefault-integer-8 @gol
+-fdefault-real-8 -fdefault-real-10 -fdefault-real-16 -fdollar-ok @gol
+-ffixed-line-length-@var{n} -ffixed-line-length-none -fpad-source @gol
+-ffree-form -ffree-line-length-@var{n} -ffree-line-length-none @gol
 -fimplicit-none -finteger-4-integer-8 -fmax-identifier-length @gol
 -fmodule-private -ffixed-form -fno-range-check -fopenacc -fopenmp @gol
 -freal-4-real-10 -freal-4-real-16 -freal-4-real-8 -freal-8-real-10 @gol
@@ -289,6 +289,11 @@ be on a single line and can use line continuations.
 Enable format specifiers F, G and I to be used without width specifiers,
 default widths will be used instead.
 
+@item -fdec-blank-format-item
+@opindex @code{fdec-blank-format-item}
+Enable a blank format item at the end of a format specification i.e. nothing
+following the final comma.
+
 @item -fdollar-ok
 @opindex @code{fdollar-ok}
 @cindex @code{$}
diff --git a/gcc/fortran/io.c b/gcc/fortran/io.c
index 776cdbf98ce..425c2b86899 100644
--- a/gcc/fortran/io.c
+++ b/gcc/fortran/io.c
@@ -762,6 +762,15 @@ format_item_1:
       error = unexpected_end;
       goto syntax;
 
+    case FMT_RPAREN:
+      if (flag_dec_blank_format_item)
+	goto finished;
+      else
+	{
+	  error = G_("Missing item in format string at %L");
+	  goto syntax;
+	}
+
     default:
       error = unexpected_element;
       goto syntax;
diff --git a/gcc/fortran/lang.opt b/gcc/fortran/lang.opt
index 93ea3d3977b..88674cb5dc7 100644
--- a/gcc/fortran/lang.opt
+++ b/gcc/fortran/lang.opt
@@ -444,6 +444,10 @@ fdec
 Fortran Var(flag_dec)
 Enable all DEC language extensions.
 
+fdec-blank-format-item
+Fortran Var(flag_dec_blank_format_item)
+Enable the use of blank format items in format strings.
+
 fdec-include
 Fortran Var(flag_dec_include)
 Enable legacy parsing of INCLUDE as statement.
diff --git a/gcc/fortran/options.c b/gcc/fortran/options.c
index 4f91486e977..3bc79ef9b45 100644
--- a/gcc/fortran/options.c
+++ b/gcc/fortran/options.c
@@ -75,6 +75,7 @@ set_dec_flags (int value)
   SET_BITFLAG (flag_dec_math, value, value);
   SET_BITFLAG (flag_dec_include, value, value);
   SET_BITFLAG (flag_dec_format_defaults, value, value);
+  SET_BITFLAG (flag_dec_blank_format_item, value, value);
 }
 
 /* Finalize DEC flags.  */
diff --git a/gcc/testsuite/gfortran.dg/dec_format_empty_item_1.f b/gcc/testsuite/gfortran.dg/dec_format_empty_item_1.f
new file mode 100644
index 00000000000..ed27c18944b
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/dec_format_empty_item_1.f
@@ -0,0 +1,19 @@
+! { dg-do run }
+! { dg-options "-fdec" }
+!
+! Test blank/empty format items in format string
+!
+! Test case contributed by Jim MacArthur <jim.macarthur@codethink.co.uk>
+! Modified by Mark Eggleston <mark.eggleston@codethink.com>
+!
+        PROGRAM blank_format_items
+          INTEGER A/0/
+
+          OPEN(1, status="scratch")
+          WRITE(1, 10) 100
+          REWIND(1)
+          READ(1, 10) A
+          IF (a.NE.100) STOP 1
+          PRINT 10, A
+10        FORMAT( I5,)
+        END
diff --git a/gcc/testsuite/gfortran.dg/dec_format_empty_item_2.f b/gcc/testsuite/gfortran.dg/dec_format_empty_item_2.f
new file mode 100644
index 00000000000..2793cb16225
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/dec_format_empty_item_2.f
@@ -0,0 +1,19 @@
+! { dg-do run }
+! { dg-options "-fdec-blank-format-item" }
+!
+! Test blank/empty format items in format string
+!
+! Test case contributed by Jim MacArthur <jim.macarthur@codethink.co.uk>
+! Modified by Mark Eggleston <mark.eggleston@codethink.com>
+!
+        PROGRAM blank_format_items
+          INTEGER A/0/
+
+          OPEN(1, status="scratch")
+          WRITE(1, 10) 100
+          REWIND(1)
+          READ(1, 10) A
+          IF (a.NE.100) STOP 1
+          PRINT 10, A
+10        FORMAT( I5,)
+        END
diff --git a/gcc/testsuite/gfortran.dg/dec_format_empty_item_3.f b/gcc/testsuite/gfortran.dg/dec_format_empty_item_3.f
new file mode 100644
index 00000000000..dbccd671bae
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/dec_format_empty_item_3.f
@@ -0,0 +1,19 @@
+! { dg-do compile }
+! { dg-options "-fdec -fno-dec-blank-format-item" }
+!
+! Test blank/empty format items in format string
+!
+! Test case contributed by Jim MacArthur <jim.macarthur@codethink.co.uk>
+! Modified by Mark Eggleston <mark.eggleston@codethink.com>
+!
+        PROGRAM blank_format_items
+          INTEGER A/0/
+
+          OPEN(1, status="scratch")
+          WRITE(1, 10) 100 ! { dg-error "FORMAT label 10 at" }
+          REWIND(1)
+          READ(1, 10) A ! { dg-error "FORMAT label 10 at" }
+          IF (a.NE.100) STOP 1
+          PRINT 10, A ! { dg-error "FORMAT label 10 at" }
+ 10       FORMAT( I5,) ! { dg-error "Missing item" }
+        END
-- 
2.11.0


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: *ping* Re: [PATCH] PR fortran/89103 - Allow blank format items in format strings
  2019-06-17 13:37                       ` Mark Eggleston
@ 2019-06-19  1:39                         ` Jerry DeLisle
  0 siblings, 0 replies; 17+ messages in thread
From: Jerry DeLisle @ 2019-06-19  1:39 UTC (permalink / raw)
  To: Mark Eggleston, sgk, Jakub Jelinek; +Cc: Thomas Koenig, fortran, gcc-patches

I will see if I can get this one.

On 6/17/19 6:37 AM, Mark Eggleston wrote:
> 
> On 12/06/2019 19:11, Steve Kargl wrote:
>> On Tue, Jun 11, 2019 at 11:50:40AM +0200, Jakub Jelinek wrote:
>>> On Tue, Jun 11, 2019 at 10:30:59AM +0100, Mark Eggleston wrote:
>>>>      Jim MacArthur <jim.macarthur@codethink.co.uk>
>>>>      Mark Eggleston <mark.eggleston@codethink.com>
>>> Two spaces before < instead of one.
>>>
>>> This is not a patch review, just comments:
>> Mark, do you plan to address any of Jakub's comments.
>> Do note, I just 'OK' Jakub's patch that uses G_()
>> forms for the strings.
> 
> Now that Jakubs's patch has been committed, please find attached an updated 
> patch and updated change logs:
> 
> gcc/fortran
> 
>      Jim MacArthur  <jim.macarthur@codethink.co.uk>
>      Mark Eggleston  <mark.eggleston@codethink.com>
> 
>      PR fortran/89103
>      * gfortran.texi: Add -fdec-blank-format-item
>      * invoke.texi: Add option to list of options.
>      * invoke.texi: Add to section on Commas in FORMAT specifications.
>      * io.c (check_format): At FMT_RPAREN goto finished if
>      -fdec-blank-format-item otherwise set error string.
>      * lang.opt: Add new option.
>      * options.c (set_dec_flags): Add SET_BITFLAG for
>      flag_dec_format_defaults.
> 
> gcc/testsuite
> 
>      Jim MacArthur  <jim.macarthur@codethink.co.uk>
>      Mark Eggleston  <mark.eggleston@codethink.com>
> 
>      PR fortran/89103
>      * gfortran.dg/dec_format_empty_item_1.f: New test.
>      * gfortran.dg/dec_format_empty_item_2.f: New test.
>      * gfortran.dg/dec_format_empty_item_3.f: New test.
> 
> as before... Please can someone commit this as do not have commit rights.
> 
>>
>> Also, do you have plans to contribute additional
>> patches (either for -fdec* extensions or preferrably
>> to help with bug fixes and new features)?  It may be
>> advantageous for you to get a commit bit.
> Yes, I do intend to contribute additional patches, mostly -fdec- patches, there 
> are also some patches unrelated to -fdec* extensions.
> 
> 

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2019-06-19  1:39 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-23  8:19 [PATCH] PR fortran/89103 - Allow blank format items in format strings Mark Eggleston
2019-06-03 11:57 ` *ping* " Mark Eggleston
2019-06-05  0:54   ` Jerry DeLisle
2019-06-07 14:34     ` Jerry DeLisle
2019-06-10  9:37       ` Mark Eggleston
2019-06-10 10:30         ` Thomas Koenig
2019-06-10 13:33           ` Mark Eggleston
2019-06-10 14:08             ` Thomas Koenig
2019-06-10 14:10               ` Mark Eggleston
2019-06-11  9:31                 ` Mark Eggleston
2019-06-11  9:50                   ` Jakub Jelinek
2019-06-11 10:49                     ` [PATCH] check_format fixes Jakub Jelinek
2019-06-12  7:24                       ` Jakub Jelinek
2019-06-12 18:07                         ` Steve Kargl
2019-06-12 18:11                     ` *ping* Re: [PATCH] PR fortran/89103 - Allow blank format items in format strings Steve Kargl
2019-06-17 13:37                       ` Mark Eggleston
2019-06-19  1:39                         ` Jerry DeLisle

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).