This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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" }


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]