public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [patch, fortran] PR31813 Warn about deleted feature: H edit descriptor
@ 2007-05-26 19:58 Jerry DeLisle
  0 siblings, 0 replies; only message in thread
From: Jerry DeLisle @ 2007-05-26 19:58 UTC (permalink / raw)
  To: Fortran List, gcc-patches

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

This patch is self explanatory.  It adds the warning and updates one test case. 
Also cleaned up some indentation.

Regression tested on x86-64-linux-gnu.

I will commit to trunk under the obvious and simple rule.

Jerry

2007-05-26  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR fortran/31813
	* io.c (check_format): Add warning for H specifier in format.

[-- Attachment #2: pr31813.diff --]
[-- Type: text/x-patch, Size: 1791 bytes --]

Index: fortran/io.c
===================================================================
*** fortran/io.c	(revision 125087)
--- fortran/io.c	(working copy)
*************** format_item_1:
*** 565,572 ****
      case FMT_L:
      case FMT_A:
      case FMT_D:
-       goto data_desc;
- 
      case FMT_H:
        goto data_desc;
  
--- 565,570 ----
*************** data_desc:
*** 718,736 ****
        break;
  
      case FMT_H:
        if(mode == MODE_STRING)
!       {
! 	format_string += value;
! 	format_length -= value;
!       }
        else
!       {
! 	while (repeat >0)
! 	 {
! 	  next_char (1);
! 	  repeat -- ;
! 	 }
!       }
       break;
  
      case FMT_IBOZ:
--- 716,738 ----
        break;
  
      case FMT_H:
+       if (!(gfc_option.allow_std & GFC_STD_GNU) && !inhibit_warnings)
+ 	gfc_warning ("The H format specifier at %C is"
+ 		     " a Fortran 95 deleted feature");
+ 
        if(mode == MODE_STRING)
! 	{
! 	  format_string += value;
! 	  format_length -= value;
! 	}
        else
! 	{
! 	  while (repeat >0)
! 	   {
! 	     next_char (1);
! 	     repeat -- ;
! 	   }
! 	}
       break;
  
      case FMT_IBOZ:
Index: testsuite/gfortran.dg/io_constraints_2.f90
===================================================================
*** testsuite/gfortran.dg/io_constraints_2.f90	(revision 125087)
--- testsuite/gfortran.dg/io_constraints_2.f90	(working copy)
*************** contains
*** 17,23 ****
    subroutine foo (i)
      integer :: i
      write (*, 100) i
!  100 format (1h , "i=", i6)                     ! This is OK.
    end subroutine foo
  
  end module global
--- 17,23 ----
    subroutine foo (i)
      integer :: i
      write (*, 100) i
!  100 format (1h , "i=", i6) ! { dg-warning "H format specifier" }
    end subroutine foo
  
  end module global

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2007-05-26 19:00 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-05-26 19:58 [patch, fortran] PR31813 Warn about deleted feature: H edit descriptor 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).