This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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] PR35030 - add type/kind information to pointer assignments


Straightforward and obvious.


2008-01-30  Daniel Franke  <franke.daniel@gmail.com>

	PR fortran/35030
	* expr.c (gfc_check_pointer_assign): Add type and kind information
	to type-mismatch message.
	(gfc_check_assign): Unify error messages.


Regression tested on i686-pc-linux-gnu.
Ok for trunk after re-entering stage1?

Regards
	Daniel
Index: expr.c
===================================================================
--- expr.c	(revision 131923)
+++ expr.c	(working copy)
@@ -2816,8 +2816,8 @@ gfc_check_assign (gfc_expr *lvalue, gfc_
       if (lvalue->ts.type == BT_LOGICAL && rvalue->ts.type == BT_LOGICAL)
 	return SUCCESS;
 
-      gfc_error ("Incompatible types in assignment at %L, %s to %s",
-		 &rvalue->where, gfc_typename (&rvalue->ts),
+      gfc_error ("Incompatible types in assignment at %L; attempted assignment "
+		 "of %s to %s", &rvalue->where, gfc_typename (&rvalue->ts),
 		 gfc_typename (&lvalue->ts));
 
       return FAILURE;
@@ -2900,8 +2900,9 @@ gfc_check_pointer_assign (gfc_expr *lval
 
   if (!gfc_compare_types (&lvalue->ts, &rvalue->ts))
     {
-      gfc_error ("Different types in pointer assignment at %L",
-		 &lvalue->where);
+      gfc_error ("Different types in pointer assignment at %L; attempted "
+		 "assignment of %s to %s", &lvalue->where, 
+		 gfc_typename (&rvalue->ts), gfc_typename (&lvalue->ts));
       return FAILURE;
     }
 

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