[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gcc-fortran
Subject:    [patch, fortran] PR35030 - add type/kind information to pointer assignments
From:       Daniel Franke <franke.daniel () gmail ! com>
Date:       2008-01-30 19:48:56
Message-ID: 200801302048.56250.franke.daniel () gmail ! com
[Download RAW message or body]

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

["pr35030.patch" (text/x-diff)]

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


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic