[patch, fortran]: PR33544 Warning in TRANSFER intrinsic should be made optional

Jerry DeLisle jvdelisle@verizon.net
Fri Oct 19 05:16:00 GMT 2007


The attached patch regression tested.  This is obvious and simple.  I see no 
need to add a special compiler option for this.

Also modified test case transfer_check_1.f90.

OK?

Jerry

2007-10-18  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR fortran/33544
	* simplify.c (gfc_simplify_transfer): Only warn for short transfer when
	-Wsurprising is given.


Index: simplify.c
===================================================================
--- simplify.c  (revision 129465)
+++ simplify.c  (working copy)
@@ -4065,7 +4065,7 @@ gfc_simplify_transfer (gfc_expr *source,
        result_size = result_elt_size;
      }

-  if (source_size < result_size)
+  if (gfc_option.warn_surprising && source_size < result_size)
      gfc_warning("Intrinsic TRANSFER at %L has partly undefined result: "
                 "source size %ld < result size %ld", &source->where,
                 (long) source_size, (long) result_size);

Index: gfortran.dg/transfer_check_1.f90
===================================================================
--- gfortran.dg/transfer_check_1.f90    (revision 129465)
+++ gfortran.dg/transfer_check_1.f90    (working copy)
@@ -1,4 +1,5 @@
  ! { dg-do compile }
+! { dg-options -Wsurprising }
  ! PR fortran/33037
  !
  print *, transfer('x', 0, 20) ! { dg-warning "has partly undefined result" }



More information about the Fortran mailing list