PR fortran/33037
* simplify.c (gfc_simplify_transfer): Warn if source size
is smaller than result size.
2007-09-21 Tobias Burnus <burnus@net-b.de>
PR fortran/33037
* gfortran.dg/transfer_check_1.f90: New.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@128646
138bc75d-0d04-0410-961f-
82ee72b054a4
+2007-09-21 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/33037
+ * simplify.c (gfc_simplify_transfer): Warn if source size
+ is smaller than result size.
+
2007-09-20 Asher Langton <langton2@llnl.gov>
PR fortran/20441
- * gfortran.h : Add init_local_* enums and init_flag_* flags to
+ * gfortran.h : Add init_local_* enums and init_flag_* flags to
gfc_option_t.
* lang.opt: Add -finit-local-zero, -finit-real, -finit-integer,
-finit-character, and -finit-logical flags.
result_size = result_elt_size;
}
+ if (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);
+
/* Allocate the buffer to store the binary version of the source. */
buffer_size = MAX (source_size, result_size);
buffer = (unsigned char*)alloca (buffer_size);
+2007-09-21 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/33037
+ * gfortran.dg/transfer_check_1.f90: New.
+
2007-09-20 Asher Langton <langton2@llnl.gov>
PR fortran/20441
--- /dev/null
+! { dg-do compile }
+! PR fortran/33037
+!
+print *, transfer('x', 0, 20) ! { dg-warning "has partly undefined result" }
+print *, transfer(1_1, 0) ! { dg-warning "has partly undefined result" }
+print *, transfer([1_2,2_2], 0)
+print *, transfer([1_2,2_2], 0_8) ! { dg-warning "has partly undefined result" }
+end