Bug 26054 - Gratuitous warning about Fortran 2003 features w/o -std=...
Summary: Gratuitous warning about Fortran 2003 features w/o -std=...
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: fortran (show other bugs)
Version: 4.2.0
: P3 normal
Target Milestone: 4.1.1
Assignee: Toon Moene
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-01-31 23:05 UTC by Harald Anlauf
Modified: 2006-03-11 12:09 UTC (History)
1 user (show)

See Also:
Host: i686-pc-linux-gnu
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2006-02-10 08:42:25


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Harald Anlauf 2006-01-31 23:05:55 UTC
Hi,

compiling the following code with the default language "level"
(is that "gnu" or something else?) leads to:

% gfortran gfcbug33.f90
 In file gfcbug33.f90:2

  print *, [ 1, 2 ]
           1
Warning: New in Fortran 2003: [...] style array constructors at (1)
% cat  gfcbug33.f90
program gfcbug33
  print *, [ 1, 2 ]
end program gfcbug33

When -std=gnu, -std=legacy or -std=f2003 is specified, then
no warning appears.  Assuming that -std=gnu is the default,
the warning is not appropriate.  I also find it kind of funny,
because [...] style array constructors are probable there to
stay and not obsolescent or deprecated.

I suggest the warning to be removed.  The error for -std=f95
is of course ok.

Cheers,
-ha
Comment 1 Andrew Pinski 2006-01-31 23:07:58 UTC
The default is somewhere inbetween -std=f90 (which does not really exist) and -std=gnu
Comment 2 Harald Anlauf 2006-01-31 23:23:27 UTC
(In reply to comment #1)
> The default is somewhere inbetween -std=f90 (which does not really exist) and
> -std=gnu

Hmmm.  Did you really mean Fortran 90 (which does exist
as a standard but not as f90 in gfortran) or Fortran 95?

Anyway, if your comment is true, then I feel this "somewhere
in between" is the real bug, unless documented as a feature
or added as an appropriate option (-std=somewhere-in-between).

[Some other compilers (like xlf) use the most loose definition
of language if none is specified.  In the case of xlf you can
explicitly confirm it with -qlanglvl=extended.]

Feel free to correct the title appropriately.

Cheers,
-ha
Comment 3 Toon Moene 2006-02-10 08:42:25 UTC
We don't warn for other Fortran 2003 features we support without a -std=f95, so I'll look into it and fix it.
Comment 4 Toon Moene 2006-02-11 13:27:22 UTC
Subject: Re:  Gratuitous warning about Fortran 2003 features w/o -std=...

> We don't warn for other Fortran 2003 features we support without a -std=f95, so
> I'll look into it and fix it.

Well, that's not true, we do.

So I'll propose a fix for the whole, to fortran@gcc.gnu.org
and gcc-patches@gcc.gnu.org.

Cheers,

Toon
Comment 5 Toon Moene 2006-02-15 21:07:03 UTC
Subject: Bug 26054

Author: toon
Date: Wed Feb 15 21:06:58 2006
New Revision: 111117

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=111117
Log:
2006-02-15  Toon Moene  <toon@moene.indiv.nluug.nl>

	PR fortran/26054
	* fortran/options.c: Do not warn for Fortran 2003 features
	by default.
	* testsuite/gfortran.dg/enum_8.f90: Remove check for warning.
	* testsuite/gfortran.dg/iomsg_1.f90: Ditto.
	* testsuite/gfortran.dg/enum_1.f90: Ditto.
	* testsuite/gfortran.dg/enum_9.f90: Ditto.
	* testsuite/gfortran.dg/enum_2.f90: Ditto.
	* testsuite/gfortran.dg/enum_10.f90: Ditto.
	* testsuite/gfortran.dg/enum_3.f90: Ditto.
	* testsuite/gfortran.dg/flush_1.f90: Ditto.
	* testsuite/gfortran.dg/enum_4.f90: Ditto.
	* testsuite/gfortran.dg/array_constructor_1.f90: Ditto.
	* testsuite/gfortran.dg/enum_5.f90: Ditto.
	* testsuite/gfortran.dg/enum_6.f90: Ditto.
	* testsuite/gfortran.dg/enum_7.f90: Ditto.


Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/options.c
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/gfortran.dg/array_constructor_1.f90
    trunk/gcc/testsuite/gfortran.dg/enum_1.f90
    trunk/gcc/testsuite/gfortran.dg/enum_10.f90
    trunk/gcc/testsuite/gfortran.dg/enum_2.f90
    trunk/gcc/testsuite/gfortran.dg/enum_3.f90
    trunk/gcc/testsuite/gfortran.dg/enum_4.f90
    trunk/gcc/testsuite/gfortran.dg/enum_5.f90
    trunk/gcc/testsuite/gfortran.dg/enum_6.f90
    trunk/gcc/testsuite/gfortran.dg/enum_7.f90
    trunk/gcc/testsuite/gfortran.dg/enum_8.f90
    trunk/gcc/testsuite/gfortran.dg/enum_9.f90
    trunk/gcc/testsuite/gfortran.dg/flush_1.f90
    trunk/gcc/testsuite/gfortran.dg/iomsg_1.f90

Comment 6 Toon Moene 2006-03-11 12:04:18 UTC
Subject: Bug 26054

Author: toon
Date: Sat Mar 11 12:04:14 2006
New Revision: 111962

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=111962
Log:
2006-03-11  Toon Moene  <toon@moene.indiv.nluug.nl>

	PR fortran/26054
	* fortran/options.c: Do not warn for Fortran 2003 features
	by default.
	* testsuite/gfortran.dg/enum_8.f90: Remove check for warning.
	* testsuite/gfortran.dg/iomsg_1.f90: Ditto.
	* testsuite/gfortran.dg/enum_1.f90: Ditto.
	* testsuite/gfortran.dg/enum_9.f90: Ditto.
	* testsuite/gfortran.dg/enum_2.f90: Ditto.
	* testsuite/gfortran.dg/enum_10.f90: Ditto.
	* testsuite/gfortran.dg/enum_3.f90: Ditto.
	* testsuite/gfortran.dg/flush_1.f90: Ditto.
	* testsuite/gfortran.dg/enum_4.f90: Ditto.
	* testsuite/gfortran.dg/array_constructor_1.f90: Ditto.
	* testsuite/gfortran.dg/enum_5.f90: Ditto.
	* testsuite/gfortran.dg/enum_6.f90: Ditto.
	* testsuite/gfortran.dg/enum_7.f90: Ditto.


Modified:
    branches/gcc-4_1-branch/gcc/fortran/ChangeLog
    branches/gcc-4_1-branch/gcc/fortran/options.c
    branches/gcc-4_1-branch/gcc/testsuite/ChangeLog
    branches/gcc-4_1-branch/gcc/testsuite/gfortran.dg/array_constructor_1.f90
    branches/gcc-4_1-branch/gcc/testsuite/gfortran.dg/enum_1.f90
    branches/gcc-4_1-branch/gcc/testsuite/gfortran.dg/enum_10.f90
    branches/gcc-4_1-branch/gcc/testsuite/gfortran.dg/enum_2.f90
    branches/gcc-4_1-branch/gcc/testsuite/gfortran.dg/enum_3.f90
    branches/gcc-4_1-branch/gcc/testsuite/gfortran.dg/enum_4.f90
    branches/gcc-4_1-branch/gcc/testsuite/gfortran.dg/enum_5.f90
    branches/gcc-4_1-branch/gcc/testsuite/gfortran.dg/enum_6.f90
    branches/gcc-4_1-branch/gcc/testsuite/gfortran.dg/enum_7.f90
    branches/gcc-4_1-branch/gcc/testsuite/gfortran.dg/enum_8.f90
    branches/gcc-4_1-branch/gcc/testsuite/gfortran.dg/enum_9.f90
    branches/gcc-4_1-branch/gcc/testsuite/gfortran.dg/flush_1.f90
    branches/gcc-4_1-branch/gcc/testsuite/gfortran.dg/iomsg_1.f90

Comment 7 Toon Moene 2006-03-11 12:09:54 UTC
Bug fix now also committed to the 4.1 branch, so will be fixed as of 4.1.1.