public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/52101] New: Obsolescence warning for non-obs. feature character name*length
@ 2012-02-03  0:11 john.harper at vuw dot ac.nz
  2012-02-03  7:22 ` [Bug fortran/52101] " burnus at gcc dot gnu.org
                   ` (11 more replies)
  0 siblings, 12 replies; 13+ messages in thread
From: john.harper at vuw dot ac.nz @ 2012-02-03  0:11 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52101

             Bug #: 52101
           Summary: Obsolescence warning for non-obs. feature character
                    name*length
    Classification: Unclassified
           Product: gcc
           Version: 4.6.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: john.harper@vuw.ac.nz


Gfortran 4.6.2 -std=f95 says a declaration character name*length is
obsolescent. IMHO it is not; the obsolescent form is character*length name.
Gfortran 4.4.4 is correct on this matter. See below.

rimu[~]$ cat obschar.f90
! Character*length is obsolescent, not character name*length 
character greet*11
greet = 'Hello world'
print *,greet
end
rimu[~]$ gfortran -v
Using built-in specs.
Target: i386-redhat-linux6E
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man
--infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla
--enable-bootstrap --enable-shared --enable-threads=posix
--enable-checking=release --with-system-zlib --enable-__cxa_atexit
--disable-libunwind-exceptions --disable-gnu-unique-object
--enable-languages=c,c++,fortran --disable-libgcj
--with-mpfr=/builddir/build/BUILD/gcc-4.4.4-20100726/obj-i386-redhat-linux6E/mpfr-install/
--with-ppl=/builddir/build/BUILD/gcc-4.4.4-20100726/obj-i386-redhat-linux6E/ppl-install
--with-cloog=/builddir/build/BUILD/gcc-4.4.4-20100726/obj-i386-redhat-linux6E/cloog-install
--with-tune=generic --with-arch=i586 --build=i386-redhat-linux6E
Thread model: posix
gcc version 4.4.4 20100726 (Red Hat 4.4.4-13) (GCC) 
rimu[~]$ gfortran -std=f95 obschar.f90
rimu[~]$ ./a.out
 Hello world
rimu[~]$ /tmp/gf/bin/gfortran -v
Using built-in specs.
COLLECT_GCC=/tmp/gf/bin/gfortran
Target: i686-pc-linux-gnu
Configured with: /tmp/gcc-4.6.2/configure --prefix=/tmp/gf
--enable-languages=c,c++,fortran --disable-libada --with-gmp=/home/harperj1
--with-mpfr-include=/home/harperj1/mpfr-3.0.0
--with-mpfr-lib=/home/harperj1/mpfr-3.0.0/.libs
--with-mpc=/home/harperj1/mpc-0.9
Thread model: posix
gcc version 4.6.2 (GCC) 
rimu[~]$ /tmp/gf/bin/gfortran -std=f95 obschar.f90
obschar.f90:2.18:

character greet*11
                  1
Warning: Obsolescent feature: Old-style character length at (1)
rimu[~]$


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

* [Bug fortran/52101] Obsolescence warning for non-obs. feature character name*length
  2012-02-03  0:11 [Bug fortran/52101] New: Obsolescence warning for non-obs. feature character name*length john.harper at vuw dot ac.nz
@ 2012-02-03  7:22 ` burnus at gcc dot gnu.org
  2012-02-03  7:31 ` burnus at gcc dot gnu.org
                   ` (10 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: burnus at gcc dot gnu.org @ 2012-02-03  7:22 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52101

Tobias Burnus <burnus at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
                 CC|                            |burnus at gcc dot gnu.org
         Resolution|                            |INVALID

--- Comment #1 from Tobias Burnus <burnus at gcc dot gnu.org> 2012-02-03 07:22:28 UTC ---
(In reply to comment #0)
> Gfortran 4.6.2 -std=f95 says a declaration character name*length is
> obsolescent. IMHO it is not; the obsolescent form is character*length name.
> 
> character greet*11
>                   1
> Warning: Obsolescent feature: Old-style character length at (1)

See Fortran 95 standard,
  http://gcc.gnu.org/wiki/GFortranStandards
  http://j3-fortran.org/doc/standing/archive/007/97-007r2/pdf/97-007r2.pdf
in Section "B.2 Obsolescent features":

"The obsolescent features are those features of Fortran 90 that were redundant
and for which better methods were available in Fortran 90. Section 1.7.2
describes the nature of the obsolescent features. The obsolescent features in
this standard are the following:
...
(9) CHARACTER* form of CHARACTER declaration - see B.2.7."


Closed as INVALID.


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

* [Bug fortran/52101] Obsolescence warning for non-obs. feature character name*length
  2012-02-03  0:11 [Bug fortran/52101] New: Obsolescence warning for non-obs. feature character name*length john.harper at vuw dot ac.nz
  2012-02-03  7:22 ` [Bug fortran/52101] " burnus at gcc dot gnu.org
@ 2012-02-03  7:31 ` burnus at gcc dot gnu.org
  2012-02-03 20:51 ` John.Harper at msor dot vuw.ac.nz
                   ` (9 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: burnus at gcc dot gnu.org @ 2012-02-03  7:31 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52101

--- Comment #2 from Tobias Burnus <burnus at gcc dot gnu.org> 2012-02-03 07:30:24 UTC ---
As postscript:

* A program which uses the CHARACTER* declaration is still perfectly valid
Fortran 95/2003/2008. - Thus, you do not have to react on the warning, you
should only avoid it for new code and could consider fixing it in the old code.

* A Fortran compiler is required to diagnose obsolescent features. From Fortran
2008, Section 1.5:

"A processor conforms to this part of ISO/IEC 1539 if:
[...]
(2) it contains the capability to detect and report the use within a submitted
program unit of a form designated herein as obsolescent, insofar as such use
can be detected by reference to the numbered syntax rules and constraints;"

That's what gfortran does if one ask for it (-std=f95/f2003/f2008/f2008tr).


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

* [Bug fortran/52101] Obsolescence warning for non-obs. feature character name*length
  2012-02-03  0:11 [Bug fortran/52101] New: Obsolescence warning for non-obs. feature character name*length john.harper at vuw dot ac.nz
  2012-02-03  7:22 ` [Bug fortran/52101] " burnus at gcc dot gnu.org
  2012-02-03  7:31 ` burnus at gcc dot gnu.org
@ 2012-02-03 20:51 ` John.Harper at msor dot vuw.ac.nz
  2012-02-03 21:17 ` kargl at gcc dot gnu.org
                   ` (8 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: John.Harper at msor dot vuw.ac.nz @ 2012-02-03 20:51 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52101

--- Comment #3 from John.Harper at msor dot vuw.ac.nz 2012-02-03 20:51:10 UTC ---
On Fri, 3 Feb 2012, burnus at gcc dot gnu.org wrote:

> Date: Fri, 3 Feb 2012 07:22:28 +0000
> From: burnus at gcc dot gnu.org <gcc-bugzilla@gcc.gnu.org>
> To: john.harper@vuw.ac.nz
> Subject: [Bug fortran/52101] Obsolescence warning for non-obs. feature
>     character name*length
> 
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52101
>
> Tobias Burnus <burnus at gcc dot gnu.org> changed:
>
>           What    |Removed                     |Added
> ----------------------------------------------------------------------------
>             Status|UNCONFIRMED                 |RESOLVED
>                 CC|                            |burnus at gcc dot gnu.org
>         Resolution|                            |INVALID
>
> --- Comment #1 from Tobias Burnus <burnus at gcc dot gnu.org> 2012-02-03 07:22:28 UTC ---
> (In reply to comment #0)
>> Gfortran 4.6.2 -std=f95 says a declaration character name*length is
>> obsolescent. IMHO it is not; the obsolescent form is character*length name.
>>
>> character greet*11
>>                   1
>> Warning: Obsolescent feature: Old-style character length at (1)
>
> See Fortran 95 standard,
>  http://gcc.gnu.org/wiki/GFortranStandards
>  http://j3-fortran.org/doc/standing/archive/007/97-007r2/pdf/97-007r2.pdf
> in Section "B.2 Obsolescent features":
>
> "The obsolescent features are those features of Fortran 90 that were redundant
> and for which better methods were available in Fortran 90. Section 1.7.2
> describes the nature of the obsolescent features. The obsolescent features in
> this standard are the following:
> ...
> (9) CHARACTER* form of CHARACTER declaration - see B.2.7."
>
>
> Closed as INVALID.
>
> -- 
> Configure bugmail: http://gcc.gnu.org/bugzilla/userprefs.cgi?tab=email
> ------- You are receiving this mail because: -------
> You reported the bug.
>
I agree that CHARACTER* declarations are obsolescent but I still claim
that putting * after the variable name instead of after CHARACTER is
not, presumably because that form of declaration is still needed for 
something like CHARACTER a*2, b*4

-- John Harper, School of Mathematics Statistics and Operations Research
Victoria University, PO Box 600, Wellington 6140, New Zealand
e-mail john.harper@vuw.ac.nz phone (+64)(4)463 5276 fax (+64)(4)463 5045


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

* [Bug fortran/52101] Obsolescence warning for non-obs. feature character name*length
  2012-02-03  0:11 [Bug fortran/52101] New: Obsolescence warning for non-obs. feature character name*length john.harper at vuw dot ac.nz
                   ` (2 preceding siblings ...)
  2012-02-03 20:51 ` John.Harper at msor dot vuw.ac.nz
@ 2012-02-03 21:17 ` kargl at gcc dot gnu.org
  2012-02-03 22:48 ` sgk at troutmask dot apl.washington.edu
                   ` (7 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: kargl at gcc dot gnu.org @ 2012-02-03 21:17 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52101

kargl at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
   Last reconfirmed|                            |2012-02-03
                 CC|                            |kargl at gcc dot gnu.org
         Resolution|INVALID                     |
     Ever Confirmed|0                           |1

--- Comment #4 from kargl at gcc dot gnu.org 2012-02-03 21:16:47 UTC ---
I believe that John is correct.  The form 'CHARACTER*n string'
is obsolescent while the form 'CHARACTER string*n' is not.
>From Sec 5.1 in the F2003 standard, 


R504  entity-decl is object-name [( array-spec )] [ * char-length ]
                     [ initialization ]
                  or function-name [ * char-length ]


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

* [Bug fortran/52101] Obsolescence warning for non-obs. feature character name*length
  2012-02-03  0:11 [Bug fortran/52101] New: Obsolescence warning for non-obs. feature character name*length john.harper at vuw dot ac.nz
                   ` (3 preceding siblings ...)
  2012-02-03 21:17 ` kargl at gcc dot gnu.org
@ 2012-02-03 22:48 ` sgk at troutmask dot apl.washington.edu
  2012-02-04  0:01 ` sgk at troutmask dot apl.washington.edu
                   ` (6 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: sgk at troutmask dot apl.washington.edu @ 2012-02-03 22:48 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52101

--- Comment #5 from Steve Kargl <sgk at troutmask dot apl.washington.edu> 2012-02-03 22:46:53 UTC ---
On Fri, Feb 03, 2012 at 09:16:47PM +0000, kargl at gcc dot gnu.org wrote:
> I believe that John is correct.  The form 'CHARACTER*n string'
> is obsolescent while the form 'CHARACTER string*n' is not.
> From Sec 5.1 in the F2003 standard, 
> 
> 
> R504  entity-decl is object-name [( array-spec )] [ * char-length ]
>                      [ initialization ]
>                   or function-name [ * char-length ]

This patch seems to do the right thing.

troutmask:sgk[208] cat foo.f90
program foo
   character*10 s
   character    t*10
   s = 'foo'
   t = 'bar'
end program foo
troutmask:sgk[209] gfc4x -c foo.f90
troutmask:sgk[210] gfc4x -c -std=f95 foo.f90
foo.f90:2.15:

   character*10 s
               1
Warning: Obsolescent feature: Old-style character length at (1)


Index: decl.c
===================================================================
--- decl.c    (revision 183872)
+++ decl.c    (working copy)
@@ -722,7 +722,7 @@ syntax:
    char_len_param_value in parenthesis.  */

 static match
-match_char_length (gfc_expr **expr, bool *deferred)
+match_char_length (gfc_expr **expr, bool *deferred, bool entity_decl)
 {
   int length;
   match m;
@@ -738,7 +738,8 @@ match_char_length (gfc_expr **expr, bool

   if (m == MATCH_YES)
     {
-      if (gfc_notify_std (GFC_STD_F95_OBS, "Obsolescent feature: "
+      if (entity_decl
+      && gfc_notify_std (GFC_STD_F95_OBS, "Obsolescent feature: "
               "Old-style character length at %C") == FAILURE)
     return MATCH_ERROR;
       *expr = gfc_get_int_expr (gfc_default_integer_kind, NULL, length);
@@ -1845,7 +1846,7 @@ variable_decl (int elem)

   if (current_ts.type == BT_CHARACTER)
     {
-      switch (match_char_length (&char_len, &cl_deferred))
+      switch (match_char_length (&char_len, &cl_deferred, false))
     {
     case MATCH_YES:
       cl = gfc_new_charlen (gfc_current_ns, NULL);
@@ -2407,7 +2408,7 @@ gfc_match_char_spec (gfc_typespec *ts)
   /* Try the old-style specification first.  */
   old_char_selector = 0;

-  m = match_char_length (&len, &deferred);
+  m = match_char_length (&len, &deferred, true);
   if (m != MATCH_NO)
     {
       if (m == MATCH_YES)


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

* [Bug fortran/52101] Obsolescence warning for non-obs. feature character name*length
  2012-02-03  0:11 [Bug fortran/52101] New: Obsolescence warning for non-obs. feature character name*length john.harper at vuw dot ac.nz
                   ` (4 preceding siblings ...)
  2012-02-03 22:48 ` sgk at troutmask dot apl.washington.edu
@ 2012-02-04  0:01 ` sgk at troutmask dot apl.washington.edu
  2012-02-05  9:59 ` burnus at gcc dot gnu.org
                   ` (5 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: sgk at troutmask dot apl.washington.edu @ 2012-02-04  0:01 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52101

--- Comment #6 from Steve Kargl <sgk at troutmask dot apl.washington.edu> 2012-02-04 00:01:08 UTC ---
On Fri, Feb 03, 2012 at 10:46:53PM +0000, sgk at troutmask dot
apl.washington.edu wrote:
> 
> Index: decl.c
> ===================================================================
> --- decl.c    (revision 183872)
> +++ decl.c    (working copy)
> @@ -722,7 +722,7 @@ syntax:
>     char_len_param_value in parenthesis.  */
> 
>  static match
> -match_char_length (gfc_expr **expr, bool *deferred)
> +match_char_length (gfc_expr **expr, bool *deferred, bool entity_decl)
>  {
>    int length;
>    match m;
> @@ -738,7 +738,8 @@ match_char_length (gfc_expr **expr, bool
> 
>    if (m == MATCH_YES)
>      {
> -      if (gfc_notify_std (GFC_STD_F95_OBS, "Obsolescent feature: "
> +      if (entity_decl
> +      && gfc_notify_std (GFC_STD_F95_OBS, "Obsolescent feature: "
>                "Old-style character length at %C") == FAILURE)
>      return MATCH_ERROR;
>        *expr = gfc_get_int_expr (gfc_default_integer_kind, NULL, length);
> @@ -1845,7 +1846,7 @@ variable_decl (int elem)
> 
>    if (current_ts.type == BT_CHARACTER)
>      {
> -      switch (match_char_length (&char_len, &cl_deferred))
> +      switch (match_char_length (&char_len, &cl_deferred, false))
>      {
>      case MATCH_YES:
>        cl = gfc_new_charlen (gfc_current_ns, NULL);
> @@ -2407,7 +2408,7 @@ gfc_match_char_spec (gfc_typespec *ts)
>    /* Try the old-style specification first.  */
>    old_char_selector = 0;
> 
> -  m = match_char_length (&len, &deferred);
> +  m = match_char_length (&len, &deferred, true);
>    if (m != MATCH_NO)
>      {
>        if (m == MATCH_YES)
> 

Regression tested fine.


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

* [Bug fortran/52101] Obsolescence warning for non-obs. feature character name*length
  2012-02-03  0:11 [Bug fortran/52101] New: Obsolescence warning for non-obs. feature character name*length john.harper at vuw dot ac.nz
                   ` (5 preceding siblings ...)
  2012-02-04  0:01 ` sgk at troutmask dot apl.washington.edu
@ 2012-02-05  9:59 ` burnus at gcc dot gnu.org
  2012-02-05 18:01 ` sgk at troutmask dot apl.washington.edu
                   ` (4 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: burnus at gcc dot gnu.org @ 2012-02-05  9:59 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52101

--- Comment #7 from Tobias Burnus <burnus at gcc dot gnu.org> 2012-02-05 09:58:46 UTC ---
(In reply to comment #4)
> I believe that John is correct.  The form 'CHARACTER*n string'
> is obsolescent while the form 'CHARACTER string*n' is not.

After re-checking the standard, I concur. However, I want to point out that a
simple quoting such as

> From Sec 5.1 in the F2003 standard, 
> R504  entity-decl is object-name [( array-spec )] [ * char-length ]
>                      [ initialization ]
>                   or function-name [ * char-length ]

is insufficient as one cannot see whether '[ * char-length ]' is obsolescent:

"The descriptions of obsolescent features appear in a smaller type size."
(F2008, 1.4.5 Text conventions).

However, I have just check it and the font size seems to be the normal one.


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

* [Bug fortran/52101] Obsolescence warning for non-obs. feature character name*length
  2012-02-03  0:11 [Bug fortran/52101] New: Obsolescence warning for non-obs. feature character name*length john.harper at vuw dot ac.nz
                   ` (6 preceding siblings ...)
  2012-02-05  9:59 ` burnus at gcc dot gnu.org
@ 2012-02-05 18:01 ` sgk at troutmask dot apl.washington.edu
  2012-02-05 18:12 ` burnus at gcc dot gnu.org
                   ` (3 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: sgk at troutmask dot apl.washington.edu @ 2012-02-05 18:01 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52101

--- Comment #8 from Steve Kargl <sgk at troutmask dot apl.washington.edu> 2012-02-05 18:00:59 UTC ---
On Sun, Feb 05, 2012 at 09:58:46AM +0000, burnus at gcc dot gnu.org wrote:
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52101
> 
> --- Comment #7 from Tobias Burnus <burnus at gcc dot gnu.org> 2012-02-05 09:58:46 UTC ---
> (In reply to comment #4)
> > I believe that John is correct.  The form 'CHARACTER*n string'
> > is obsolescent while the form 'CHARACTER string*n' is not.
> 
> After re-checking the standard, I concur. However, I want to point out that a
> simple quoting such as
> 
> > From Sec 5.1 in the F2003 standard, 
> > R504  entity-decl is object-name [( array-spec )] [ * char-length ]
> >                      [ initialization ]
> >                   or function-name [ * char-length ]
> 
> is insufficient as one cannot see whether '[ * char-length ]' is obsolescent:
> 
> "The descriptions of obsolescent features appear in a smaller type size."
> (F2008, 1.4.5 Text conventions).
> 
> However, I have just check it and the font size seems to be the normal one.
> 

It is sufficient once one reads B.2.8.

  B.2.8   CHARACTER* form of CHARACTER declaration

  In addition to the CHARACTER*char-length form introduced in Fortran
  77, Fortran 90 provided the CHARACTER([ LEN = ] type-param-value)
  form.  The older form (CHARACTER*char-length) is redundant.

This clear applies to the BNF give by R403 -> R404 -> R421.


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

* [Bug fortran/52101] Obsolescence warning for non-obs. feature character name*length
  2012-02-03  0:11 [Bug fortran/52101] New: Obsolescence warning for non-obs. feature character name*length john.harper at vuw dot ac.nz
                   ` (7 preceding siblings ...)
  2012-02-05 18:01 ` sgk at troutmask dot apl.washington.edu
@ 2012-02-05 18:12 ` burnus at gcc dot gnu.org
  2012-07-16 19:38 ` burnus at gcc dot gnu.org
                   ` (2 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: burnus at gcc dot gnu.org @ 2012-02-05 18:12 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52101

--- Comment #9 from Tobias Burnus <burnus at gcc dot gnu.org> 2012-02-05 18:11:41 UTC ---
(In reply to comment #8)
> > However, I have just check it and the font size seems to be the normal one.
> 
> It is sufficient once one reads B.2.8.

No, it isn't. B.1.8 gives a good hint, but not everything which is obsolescent
is in Appendix B. Additionally, Appendix B is only "informative". Thus, only
the font size of R504 matters, independent what nonnormative parts of the
standard claim.

However, we do not need to discuss this at length as of us agree that "entry-
name*len" is not obsolescent and only "character*len" is.


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

* [Bug fortran/52101] Obsolescence warning for non-obs. feature character name*length
  2012-02-03  0:11 [Bug fortran/52101] New: Obsolescence warning for non-obs. feature character name*length john.harper at vuw dot ac.nz
                   ` (8 preceding siblings ...)
  2012-02-05 18:12 ` burnus at gcc dot gnu.org
@ 2012-07-16 19:38 ` burnus at gcc dot gnu.org
  2012-07-17  9:40 ` burnus at gcc dot gnu.org
  2012-07-17 11:28 ` burnus at gcc dot gnu.org
  11 siblings, 0 replies; 13+ messages in thread
From: burnus at gcc dot gnu.org @ 2012-07-16 19:38 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52101

--- Comment #10 from Tobias Burnus <burnus at gcc dot gnu.org> 2012-07-16 19:38:33 UTC ---
Untested patch:

--- a/gcc/fortran/decl.c
+++ b/gcc/fortran/decl.c
@@ -725,3 +729,3 @@ syntax:
 static match
-match_char_length (gfc_expr **expr, bool *deferred)
+match_char_length (gfc_expr **expr, bool *deferred, bool obsolenscent_check)
 {
@@ -741,4 +745,5 @@ match_char_length (gfc_expr **expr, bool *deferred)
     {
-      if (gfc_notify_std (GFC_STD_F95_OBS, "Obsolescent feature: "
-                         "Old-style character length at %C") == FAILURE)
+      if (obsolenscent_check
+         && gfc_notify_std (GFC_STD_F95_OBS, "Obsolescent feature: "
+                            "Old-style character length at %C") == FAILURE)
        return MATCH_ERROR;
@@ -1029,3 +1034,3 @@ gfc_verify_c_interop_param (gfc_symbol *sym)
                           sym->ns->proc_name->name);
-             else
+             else if (gfc_option.warn_c_binding_type)
                gfc_warning ("Variable '%s' at %L is a parameter to the "
@@ -1851,3 +1856,3 @@ variable_decl (int elem)
     {
-      switch (match_char_length (&char_len, &cl_deferred))
+      switch (match_char_length (&char_len, &cl_deferred), false)
        {
@@ -2413,3 +2418,3 @@ gfc_match_char_spec (gfc_typespec *ts)

-  m = match_char_length (&len, &deferred);
+  m = match_char_length (&len, &deferred, true);
   if (m != MATCH_NO)


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

* [Bug fortran/52101] Obsolescence warning for non-obs. feature character name*length
  2012-02-03  0:11 [Bug fortran/52101] New: Obsolescence warning for non-obs. feature character name*length john.harper at vuw dot ac.nz
                   ` (9 preceding siblings ...)
  2012-07-16 19:38 ` burnus at gcc dot gnu.org
@ 2012-07-17  9:40 ` burnus at gcc dot gnu.org
  2012-07-17 11:28 ` burnus at gcc dot gnu.org
  11 siblings, 0 replies; 13+ messages in thread
From: burnus at gcc dot gnu.org @ 2012-07-17  9:40 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52101

--- Comment #11 from Tobias Burnus <burnus at gcc dot gnu.org> 2012-07-17 09:40:18 UTC ---
Author: burnus
Date: Tue Jul 17 09:40:12 2012
New Revision: 189565

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=189565
Log:
2012-07-17  Tobias Burnus  <burnus@net-b.de>

        PR fortran/52101
        * decl.c (match_char_length): Extra argument, show obsolenscent
        warning only if *length is used after the typename.
        (variable_decl, gfc_match_char_spec): Update call

2012-07-17  Tobias Burnus  <burnus@net-b.de>

        PR fortran/52101
        * gfortran.dg/oldstyle_4.f90: New.


Added:
    trunk/gcc/testsuite/gfortran.dg/oldstyle_4.f90
Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/decl.c
    trunk/gcc/testsuite/ChangeLog


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

* [Bug fortran/52101] Obsolescence warning for non-obs. feature character name*length
  2012-02-03  0:11 [Bug fortran/52101] New: Obsolescence warning for non-obs. feature character name*length john.harper at vuw dot ac.nz
                   ` (10 preceding siblings ...)
  2012-07-17  9:40 ` burnus at gcc dot gnu.org
@ 2012-07-17 11:28 ` burnus at gcc dot gnu.org
  11 siblings, 0 replies; 13+ messages in thread
From: burnus at gcc dot gnu.org @ 2012-07-17 11:28 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52101

Tobias Burnus <burnus at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |RESOLVED
         Resolution|                            |FIXED

--- Comment #12 from Tobias Burnus <burnus at gcc dot gnu.org> 2012-07-17 11:28:09 UTC ---
That's now FIXED on the trunk (for GCC 4.8).

Thanks for the report!


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

end of thread, other threads:[~2012-07-17 11:28 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-02-03  0:11 [Bug fortran/52101] New: Obsolescence warning for non-obs. feature character name*length john.harper at vuw dot ac.nz
2012-02-03  7:22 ` [Bug fortran/52101] " burnus at gcc dot gnu.org
2012-02-03  7:31 ` burnus at gcc dot gnu.org
2012-02-03 20:51 ` John.Harper at msor dot vuw.ac.nz
2012-02-03 21:17 ` kargl at gcc dot gnu.org
2012-02-03 22:48 ` sgk at troutmask dot apl.washington.edu
2012-02-04  0:01 ` sgk at troutmask dot apl.washington.edu
2012-02-05  9:59 ` burnus at gcc dot gnu.org
2012-02-05 18:01 ` sgk at troutmask dot apl.washington.edu
2012-02-05 18:12 ` burnus at gcc dot gnu.org
2012-07-16 19:38 ` burnus at gcc dot gnu.org
2012-07-17  9:40 ` burnus at gcc dot gnu.org
2012-07-17 11:28 ` burnus at gcc dot gnu.org

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).