[Bug fortran/60751] Extra comma in WRITE statement not diagnosed

2016-06-12 Thread w6ws at earthlink dot net
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60751

--- Comment #25 from Walter Spector  ---
Thank you Dominique!

Walter

[Bug fortran/60751] Extra comma in WRITE statement not diagnosed

2016-06-12 Thread dominiq at lps dot ens.fr
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60751

Dominique d'Humieres  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

--- Comment #24 from Dominique d'Humieres  ---
Fixed on trunk and the gcc-5 and 6 branches. Thanks for the report. Closing.

[Bug fortran/60751] Extra comma in WRITE statement not diagnosed

2016-06-12 Thread dominiq at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60751

--- Comment #23 from dominiq at gcc dot gnu.org ---
Author: dominiq
Date: Sun Jun 12 18:25:25 2016
New Revision: 237340

URL: https://gcc.gnu.org/viewcvs?rev=237340&root=gcc&view=rev
Log:
2016-06-12  Dominique d'Humieres  

PR fortran/60751
* io.c (gfc_resolve_dt): Replace GFC_STD_GNU with GFC_STD_LEGACY.

* gfortran.dg/comma_IO_extension_1.f90: New test.
* gfortran.dg/comma_IO_extension_2.f90: Likewise.
* gfortran.dg/array_constructor_49.f90: Remove extra comma in WRITE
statement.
* gfortran.dg/graphite/pr38083.f90: Likewise.
* gfortran.dg/guality/pr41558.f90: Likewise.
* gfortran.dg/integer_exponentiation_6.F90: Likewise and add
missing format.


Added:
branches/gcc-5-branch/gcc/testsuite/gfortran.dg/comma_IO_extension_1.f90
branches/gcc-5-branch/gcc/testsuite/gfortran.dg/comma_IO_extension_2.f90
Modified:
branches/gcc-5-branch/gcc/fortran/ChangeLog
branches/gcc-5-branch/gcc/fortran/io.c
branches/gcc-5-branch/gcc/testsuite/ChangeLog
branches/gcc-5-branch/gcc/testsuite/gfortran.dg/array_constructor_49.f90
branches/gcc-5-branch/gcc/testsuite/gfortran.dg/graphite/pr38083.f90
branches/gcc-5-branch/gcc/testsuite/gfortran.dg/guality/pr41558.f90
   
branches/gcc-5-branch/gcc/testsuite/gfortran.dg/integer_exponentiation_6.F90

[Bug fortran/60751] Extra comma in WRITE statement not diagnosed

2016-06-12 Thread dominiq at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60751

--- Comment #22 from dominiq at gcc dot gnu.org ---
Author: dominiq
Date: Sun Jun 12 14:04:08 2016
New Revision: 237337

URL: https://gcc.gnu.org/viewcvs?rev=237337&root=gcc&view=rev
Log:
2016-06-12  Dominique d'Humieres  

PR fortran/60751
* io.c (gfc_resolve_dt): Replace GFC_STD_GNU with GFC_STD_LEGACY.

* gfortran.dg/comma_IO_extension_1.f90: New test.
* gfortran.dg/comma_IO_extension_2.f90: Likewise.
* gfortran.dg/array_constructor_49.f90: Remove extra comma in WRITE
statement.
* gfortran.dg/graphite/pr38083.f90: Likewise.
* gfortran.dg/guality/pr41558.f90: Likewise.
* gfortran.dg/integer_exponentiation_6.F90: Likewise and add
missing format.


Added:
branches/gcc-6-branch/gcc/testsuite/gfortran.dg/comma_IO_extension_1.f90
branches/gcc-6-branch/gcc/testsuite/gfortran.dg/comma_IO_extension_2.f90
Modified:
branches/gcc-6-branch/gcc/fortran/ChangeLog
branches/gcc-6-branch/gcc/fortran/io.c
branches/gcc-6-branch/gcc/testsuite/ChangeLog
branches/gcc-6-branch/gcc/testsuite/gfortran.dg/array_constructor_49.f90
branches/gcc-6-branch/gcc/testsuite/gfortran.dg/graphite/pr38083.f90
branches/gcc-6-branch/gcc/testsuite/gfortran.dg/guality/pr41558.f90
   
branches/gcc-6-branch/gcc/testsuite/gfortran.dg/integer_exponentiation_6.F90

[Bug fortran/60751] Extra comma in WRITE statement not diagnosed

2016-06-11 Thread dominiq at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60751

--- Comment #21 from dominiq at gcc dot gnu.org ---
Author: dominiq
Date: Sat Jun 11 22:36:50 2016
New Revision: 237332

URL: https://gcc.gnu.org/viewcvs?rev=237332&root=gcc&view=rev
Log:
2016-06-12  Dominique d'Humieres  

PR target/60751
* gfortran.dg/guality/pr41558.f90: Remove extra comma in WRITE
statement.


Modified:
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/gfortran.dg/guality/pr41558.f90

[Bug fortran/60751] Extra comma in WRITE statement not diagnosed

2016-06-11 Thread dominiq at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60751

--- Comment #20 from dominiq at gcc dot gnu.org ---
Author: dominiq
Date: Sat Jun 11 19:21:22 2016
New Revision: 237330

URL: https://gcc.gnu.org/viewcvs?rev=237330&root=gcc&view=rev
Log:
2016-06-11  Dominique d'Humieres  

PR target/60751
* gfortran.dg/comma_IO_extension_1.f90: New test.
* gfortran.dg/comma_IO_extension_2.f90: Likewise.


Added:
trunk/gcc/testsuite/gfortran.dg/comma_IO_extension_1.f90
trunk/gcc/testsuite/gfortran.dg/comma_IO_extension_2.f90

[Bug fortran/60751] Extra comma in WRITE statement not diagnosed

2016-06-11 Thread dominiq at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60751

--- Comment #19 from dominiq at gcc dot gnu.org ---
Author: dominiq
Date: Sat Jun 11 19:19:43 2016
New Revision: 237329

URL: https://gcc.gnu.org/viewcvs?rev=237329&root=gcc&view=rev
Log:
2016-06-11  Dominique d'Humieres  

PR fortran/60751
* io.c (gfc_resolve_dt): Replace GFC_STD_GNU with GFC_STD_LEGACY.

* gfortran.dg/comma_IO_extension_1.f90: New test.
* gfortran.dg/comma_IO_extension_2.f90: Likewise.
* gfortran.dg/array_constructor_49.f90: Remove extra comma in WRITE
statement.
* gfortran.dg/graphite/pr38083.f90: Likewise.
* gfortran.dg/integer_exponentiation_6.F90: Likewise and add
missing format.

--This line

Mfortran/ChangeLog
Mfortran/io.c
Mtestsuite/ChangeLog
Mtestsuite/gfortran.dg/array_constructor_49.f90
Mtestsuite/gfortran.dg/graphite/pr38083.f90
Mtestsuite/gfortran.dg/integer_exponentiation_6.F90

Modified:
trunk/gcc/fortran/ChangeLog
trunk/gcc/fortran/io.c
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/gfortran.dg/array_constructor_49.f90
trunk/gcc/testsuite/gfortran.dg/graphite/pr38083.f90
trunk/gcc/testsuite/gfortran.dg/integer_exponentiation_6.F90

[Bug fortran/60751] Extra comma in WRITE statement not diagnosed

2016-04-10 Thread jvdelisle at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60751

--- Comment #18 from Jerry DeLisle  ---
(In reply to Dominique d'Humieres from comment #17)
> Note that the extra comma is used in the following tests:
> 
> gfortran.dg/array_constructor_49.f90
> gfortran.dg/integer_exponentiation_6.F90
> gfortran.dg/graphite/pr38083.f90
> 
> Any reason to keep it?

No, and I am planning to fix the diagnostic on this.

[Bug fortran/60751] Extra comma in WRITE statement not diagnosed

2016-04-07 Thread dominiq at lps dot ens.fr
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60751

--- Comment #17 from Dominique d'Humieres  ---
Note that the extra comma is used in the following tests:

gfortran.dg/array_constructor_49.f90
gfortran.dg/integer_exponentiation_6.F90
gfortran.dg/graphite/pr38083.f90

Any reason to keep it?

[Bug fortran/60751] Extra comma in WRITE statement not diagnosed

2016-04-07 Thread dominiq at lps dot ens.fr
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60751

Dominique d'Humieres  changed:

   What|Removed |Added

 CC||valeryweber at hotmail dot com

--- Comment #16 from Dominique d'Humieres  ---
*** Bug 70575 has been marked as a duplicate of this bug. ***

[Bug fortran/60751] Extra comma in WRITE statement not diagnosed

2015-08-30 Thread dominiq at lps dot ens.fr
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60751

Dominique d'Humieres  changed:

   What|Removed |Added

 Status|WAITING |NEW

--- Comment #15 from Dominique d'Humieres  ---
> Yes, it would be fine with me to recategorize the error as GFC_STD_LEGACY.

Thanks for the answer, but the ping was intended to the gfortran maintainers (I
knew your answer). If there is no objection in the coming week, I'll commit the
change under the obvious rule.


[Bug fortran/60751] Extra comma in WRITE statement not diagnosed

2015-08-30 Thread w6ws at earthlink dot net
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60751

--- Comment #14 from Walter Spector  ---
Hi Dominique,

I am sorry I didn't see or respond to your comment from last year.  Thank you
for the ping.

Yes, it would be fine with me to recategorize the error as GFC_STD_LEGACY.

Walter


[Bug fortran/60751] Extra comma in WRITE statement not diagnosed

2015-08-30 Thread dominiq at lps dot ens.fr
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60751

--- Comment #13 from Dominique d'Humieres  ---
> Is there an agreement to downgrade the error from GFC_STD_GNU in
>
> gcc/fortran/io.c:  && !gfc_notify_std (GFC_STD_GNU, "Comma before i/o
> item list at %L", 
>
> to GFC_STD_LEGACY? If yes, I'll submit a patch. If not, this PR should be
> closed as WONTFIX.

PING! Without answer, I'll close the PR as WONTFIX.


[Bug fortran/60751] Extra comma in WRITE statement not diagnosed

2014-12-06 Thread dominiq at lps dot ens.fr
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60751

--- Comment #12 from Dominique d'Humieres  ---
Is there an agreement to downgrade the error from GFC_STD_GNU in

gcc/fortran/io.c:  && !gfc_notify_std (GFC_STD_GNU, "Comma before i/o item
list at %L", 

to GFC_STD_LEGACY? If yes, I'll submit a patch. If not, this PR should be
closed as WONTFIX.


[Bug fortran/60751] Extra comma in WRITE statement not diagnosed

2014-04-06 Thread jvdelisle at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60751

Jerry DeLisle  changed:

   What|Removed |Added

 CC||jvdelisle at gcc dot gnu.org

--- Comment #11 from Jerry DeLisle  ---
We could just change this to a -std=legacy or a warning that would not appear
with -w.


[Bug fortran/60751] Extra comma in WRITE statement not diagnosed

2014-04-06 Thread sgk at troutmask dot apl.washington.edu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60751

--- Comment #10 from Steve Kargl  ---
On Sun, Apr 06, 2014 at 03:45:08PM +, w6ws at earthlink dot net wrote:
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60751
> 
> --- Comment #9 from Walter Spector  ---
> Harald and Steve: I am quite aware of the std= options, thanks.
> 
> My main point is that the default situation violates the Principle of Least
> Astonishment.

And my point is that the feature/bug is there solely for
backwards compatibility with g77.  A POLA issue back when
gfortran first replaced g77 in GCC.  Just last week in
c.l.f there was a long thread from someone who could not
use gfortran to build his legacy code, because gfortran
does not support a number of g77's old -fugly-* options.

In hindsight, I now regret contributing a number of patches
to implement g77 compatibility and common vendor extensions.
In fact, I think the default should be -std=f95+f2003+f2008.
If the feature isn't in one of the standards, an error should
be issued without an explicit option to permit the feature.
Unfortrunately, the horse left the barn years ago.


[Bug fortran/60751] Extra comma in WRITE statement not diagnosed

2014-04-06 Thread w6ws at earthlink dot net
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60751

--- Comment #9 from Walter Spector  ---
Harald and Steve: I am quite aware of the std= options, thanks.

My main point is that the default situation violates the Principle of Least
Astonishment.  I don't have a problem with gfortran offering such an extension
(though I think providing it in the first place was a waste of time).  But
since it offers no desireable new capability, and allows gratuitous
incompatibility with other compilers, it would at least be worth a warning. 
The ideal would be to only allow it under a -f option - but don't do that on my
account.

In fact the gfortran man page for the -std= argument states:

   "...The default
   value for std is gnu, which specifies a superset of the Fortran 95
   standard that includes all of the extensions supported by GNU
   Fortran, although warnings will be given for obsolete extensions
   not recommended for use in new code..."

I would opine that this extension is obsolete and not recommeded for use in new
code.  Therefore a warning should be given.


[Bug fortran/60751] Extra comma in WRITE statement not diagnosed

2014-04-05 Thread kargl at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60751

kargl at gcc dot gnu.org changed:

   What|Removed |Added

 CC||kargl at gcc dot gnu.org

--- Comment #8 from kargl at gcc dot gnu.org ---
(In reply to Walter Spector from comment #6)
> Adding that both READ and WRITE have this issue.  Interestingly, the
> iolength version of INQUIRE does not:
> 
>   inquire (iolength=i), i
>   1
> Error: Expected expression in INQUIRE statement at (1)

It a g77 compatibility issue.  From the g77 manual (page 190),

ยท The commas in `READ (5), I' and `WRITE (10), J'.
  These commas are disallowed by FORTRAN 77, but, while strictly superfluous,
  are syntactically elegant, especially given that commas are required in
  statements such as `READ 99, I' and `PRINT *, J'. Many compilers permit
  the superfluous commas for this reason.

This is part of GNU Fortran, which I agree a cesspool of vendor
extensions.  I doubt that this will be changed (too many more
important things to work on).  If you want strict conformance,
it is probably best to add -std=f95 or -std=f2003, or -std=2008
to your command line.

[Bug fortran/60751] Extra comma in WRITE statement not diagnosed

2014-04-05 Thread anlauf at gmx dot de
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60751

--- Comment #7 from Harald Anlauf  ---
(In reply to Walter Spector from comment #5)
> > It seems quite trivial to fix, but does it really worth the work?
> 
> Well, we had an instance where this accidentally slipped into our code. 
> Later on, our nightly regression runs crashed with several non-gfortran (and
> non-Intel) compilers.

If you want diagnostics of standard violations, you might consider adding
-std=f2008 (e.g.) to the compile flags in your test suite.  Most compilers
allow "their" set of extensions by default.

> The extension itself is pretty gratuitous.  It adds nothing to the language,
> yet can quietly promote incompatibilities.  Since g95 also accepts it, I am
> assuming it came into the compiler before the split.


[Bug fortran/60751] Extra comma in WRITE statement not diagnosed

2014-04-05 Thread w6ws at earthlink dot net
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60751

--- Comment #6 from Walter Spector  ---
Adding that both READ and WRITE have this issue.  Interestingly, the iolength
version of INQUIRE does not:

  inquire (iolength=i), i
  1
Error: Expected expression in INQUIRE statement at (1)


[Bug fortran/60751] Extra comma in WRITE statement not diagnosed

2014-04-05 Thread w6ws at earthlink dot net
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60751

--- Comment #5 from Walter Spector  ---
> It seems quite trivial to fix, but does it really worth the work?

Well, we had an instance where this accidentally slipped into our code.  Later
on, our nightly regression runs crashed with several non-gfortran (and
non-Intel) compilers.

The extension itself is pretty gratuitous.  It adds nothing to the language,
yet can quietly promote incompatibilities.  Since g95 also accepts it, I am
assuming it came into the compiler before the split.


[Bug fortran/60751] Extra comma in WRITE statement not diagnosed

2014-04-05 Thread dominiq at lps dot ens.fr
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60751

Dominique d'Humieres  changed:

   What|Removed |Added

 Status|UNCONFIRMED |WAITING
   Last reconfirmed||2014-04-05
 Ever confirmed|0   |1

--- Comment #4 from Dominique d'Humieres  ---
> My thoughts are that a warning message should be issued, rather than
> quietly accepting the extension by default.

It seems quite trivial to fix, but does it really worth the work?


[Bug fortran/60751] Extra comma in WRITE statement not diagnosed

2014-04-03 Thread w6ws at earthlink dot net
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60751

--- Comment #3 from Walter Spector  ---
I didn't complain to Intel, but I can...

However the compilers that did catch it by default were NAG, lahey, and Absoft.

Walter


[Bug fortran/60751] Extra comma in WRITE statement not diagnosed

2014-04-03 Thread anlauf at gmx dot de
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60751

Harald Anlauf  changed:

   What|Removed |Added

 CC||anlauf at gmx dot de

--- Comment #2 from Harald Anlauf  ---
gfortran is quite in line with other compilers.  ifort is also quiet by
default.
However,

% gfc-trunk prxxx.f90 -std=f2008
prxxx.f90:4.13:

  write (*,*), 1, 2, 3
 1
Error: GNU Extension: Comma before i/o item list at (1)

% ifort prxxx.f90 -stand f08
prxxx.f90(4): warning #5198: Use of comma to separate io-access spec and
io_list is non_standard.
  write (*,*), 1, 2, 3
-^

So gfortran is even stricter than ifort.  Did you complain to Intel?


[Bug fortran/60751] Extra comma in WRITE statement not diagnosed

2014-04-03 Thread w6ws at earthlink dot net
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60751

--- Comment #1 from Walter Spector  ---
Simple test case:

program extracomma
  implicit none

  write (*,*), 1, 2, 3
end program

This compiles without error.

I notice that if I compile with -std=f95, it does diagnose this as a GNU
Extension.  My thoughts are that a warning message should be issued, rather
than quietly accepting the extension by default.