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]

Re: [mainline] PATCH: Bye bye {pedwarn, warning, error}_with_decl


gdr@integrable-solutions.net writes:

| This patch basically removes pedwarn_with_decl, warnin_with_decl and
| error_with_decl definitely from GCC.

The pieces attached below were missing.
Sorry for the confusion.

-- Gaby
Index: ChangeLog
===================================================================
RCS file: /cvs/gcc/gcc/gcc/ChangeLog,v
retrieving revision 2.619
diff -p -r2.619 ChangeLog
*** ChangeLog	25 Jul 2003 09:52:14 -0000	2.619
--- ChangeLog	25 Jul 2003 10:25:11 -0000
***************
*** 1,5 ****
--- 1,13 ----
  2003-07-25  Gabriel Dos Reis  <gdr@integrable-solutions.net>
  
+ 	* objc/objc-act.c (objc_check_decl): Don't use xxx_with_decl.
+ 	(objc_declare_class): Likewise.
+ 	(error_with_ivar): Likewise.
+ 	(start_class): Likewise.
+ 	(warn_with_method): Likewise.
+ 
+ 2003-07-25  Gabriel Dos Reis  <gdr@integrable-solutions.net>
+ 
  	Remove pedwarn_with_decl, warning_with_decl and error_with_decl
  	from GCC. 
  	* calls.c (try_to_integrate): Don't use xxx_with_decl.
Index: objc/objc-act.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/objc/objc-act.c,v
retrieving revision 1.184
diff -p -r1.184 objc-act.c
*** objc/objc-act.c	19 Jul 2003 16:09:51 -0000	1.184
--- objc/objc-act.c	25 Jul 2003 10:25:14 -0000
*************** objc_check_decl (decl)
*** 915,921 ****
    if (TREE_CODE (type) == RECORD_TYPE
        && TREE_STATIC_TEMPLATE (type)
        && type != constant_string_type)
!     error_with_decl (decl, "`%s' cannot be statically allocated");
  }
  
  /* Implement static typing.  At this point, we know we have an interface.  */
--- 915,922 ----
    if (TREE_CODE (type) == RECORD_TYPE
        && TREE_STATIC_TEMPLATE (type)
        && type != constant_string_type)
!     error ("%H'%D' cannot be statically allocated",
!            &DECL_SOURCE_LOCATION (decl), decl);
  }
  
  /* Implement static typing.  At this point, we know we have an interface.  */
*************** objc_declare_class (ident_list)
*** 2370,2376 ****
  	{
  	  error ("`%s' redeclared as different kind of symbol",
  		  IDENTIFIER_POINTER (ident));
! 	  error_with_decl (decl, "previous declaration of `%s'");
  	}
  
        if (! is_class_name (ident))
--- 2371,2378 ----
  	{
  	  error ("`%s' redeclared as different kind of symbol",
  		  IDENTIFIER_POINTER (ident));
! 	  error ("%Hprevious declaration of '%D'",
!                  &DECL_SOURCE_LOCATION (decl), decl);
  	}
  
        if (! is_class_name (ident))
*************** start_class (code, class_name, super_nam
*** 6116,6122 ****
      {
        error ("`%s' redeclared as different kind of symbol",
  	     IDENTIFIER_POINTER (class_name));
!       error_with_decl (decl, "previous declaration of `%s'");
      }
  
    if (code == CLASS_IMPLEMENTATION_TYPE)
--- 6118,6125 ----
      {
        error ("`%s' redeclared as different kind of symbol",
  	     IDENTIFIER_POINTER (class_name));
!       error ("%Hprevious declaration of '%D'",
!              &DECL_SOURCE_LOCATION (decl), decl);
      }
  
    if (code == CLASS_IMPLEMENTATION_TYPE)
Index: java/ChangeLog
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/ChangeLog,v
retrieving revision 1.1231
diff -p -r1.1231 ChangeLog
*** java/ChangeLog	24 Jul 2003 20:48:09 -0000	1.1231
--- java/ChangeLog	25 Jul 2003 10:25:24 -0000
***************
*** 1,3 ****
--- 1,15 ----
+ 2003-07-25  Gabriel Dos Reis  <gdr@integrable-solutions.net>
+ 
+ 	* expr.c (expand_java_field_op): Don't use xxx_with_decl
+ 	(expand_java_field_op): Likewise.
+ 	* class.c (layout_class_method): Likewise
+ 	(emit_register_classes): Likewise.
+ 	* decl.c (pushdecl): Likewise.
+ 	(poplevel): Likewise.
+ 	(force_poplevels): Likewise.
+ 	(give_name_to_locals): Likewise.
+ 	* check-init.c (check_for_initialization): Likewise.
+ 
  2003-07-24  Jason Merrill  <jason@redhat.com>
  
  	* java-tree.h: Move boolean_type_node et al to the back end.
Index: java/check-init.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/check-init.c,v
retrieving revision 1.49
diff -p -r1.49 check-init.c
*** java/check-init.c	1 May 2003 16:13:35 -0000	1.49
--- java/check-init.c	25 Jul 2003 10:25:24 -0000
*************** check_for_initialization (tree body, tre
*** 977,983 ****
  	      if (index >= 0 && ! ASSIGNED_P (before, index))
  		{
  		  if (! is_finit_method)
! 		    error_with_decl (decl, "final field '%s' may not have been initialized");
  		}
  	      else if (is_finit_method)
  		DECL_FIELD_FINAL_IUD (decl) = 1;
--- 977,984 ----
  	      if (index >= 0 && ! ASSIGNED_P (before, index))
  		{
  		  if (! is_finit_method)
! 		    error ("%Hfinal field '%D' may not have been initialized",
!                            &DECL_SOURCE_LOCATION (decl), decl);
  		}
  	      else if (is_finit_method)
  		DECL_FIELD_FINAL_IUD (decl) = 1;
Index: java/class.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/class.c,v
retrieving revision 1.161
diff -p -r1.161 class.c
*** java/class.c	19 Jul 2003 16:09:48 -0000	1.161
--- java/class.c	25 Jul 2003 10:25:25 -0000
*************** get_dispatch_table (tree type, tree this
*** 1211,1218 ****
        if (METHOD_ABSTRACT (method))
  	{
  	  if (! abstract_p)
! 	    warning_with_decl (method,
! 			       "abstract method in non-abstract class");
  
  	  if (TARGET_VTABLE_USES_DESCRIPTORS)
  	    for (j = 0; j < TARGET_VTABLE_USES_DESCRIPTORS; ++j)
--- 1211,1218 ----
        if (METHOD_ABSTRACT (method))
  	{
  	  if (! abstract_p)
! 	    warning ("%Habstract method in non-abstract class",
!                      &DECL_SOURCE_FILE (method));
  
  	  if (TARGET_VTABLE_USES_DESCRIPTORS)
  	    for (j = 0; j < TARGET_VTABLE_USES_DESCRIPTORS; ++j)
*************** layout_class_method (tree this_class, tr
*** 1927,1934 ****
  	  DECL_VINDEX (method_decl) = DECL_VINDEX (super_method);
  	  if (DECL_VINDEX (method_decl) == NULL_TREE 
  	      && !CLASS_FROM_SOURCE_P (this_class))
! 	    error_with_decl (method_decl,
! 			     "non-static method '%s' overrides static method");
  	}
        else if (! METHOD_FINAL (method_decl)
  	       && ! METHOD_PRIVATE (method_decl)
--- 1927,1934 ----
  	  DECL_VINDEX (method_decl) = DECL_VINDEX (super_method);
  	  if (DECL_VINDEX (method_decl) == NULL_TREE 
  	      && !CLASS_FROM_SOURCE_P (this_class))
! 	    error ("%Hnon-static method '%D' overrides static method",
!                    &DECL_SOURCE_LOCATION (method_decl), method_decl);
  	}
        else if (! METHOD_FINAL (method_decl)
  	       && ! METHOD_PRIVATE (method_decl)
Index: java/decl.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/decl.c,v
retrieving revision 1.156
diff -p -r1.156 decl.c
*** java/decl.c	1 Jul 2003 09:00:45 -0000	1.156
--- java/decl.c	25 Jul 2003 10:25:26 -0000
*************** pushdecl (tree x)
*** 1022,1028 ****
  	/* error_mark_node is 0 for a while during initialization!  */
  	{
  	  t = 0;
! 	  error_with_decl (x, "`%s' used prior to declaration");
  	}
  
        if (t != 0)
--- 1022,1029 ----
  	/* error_mark_node is 0 for a while during initialization!  */
  	{
  	  t = 0;
! 	  error ("%H'%D' used prior to declaration",
!                  &DECL_SOURCE_LOCATION (x), x);
  	}
  
        if (t != 0)
*************** poplevel (int keep, int reverse, int fun
*** 1364,1375 ****
  
  	  if (DECL_INITIAL (label) == 0)
  	    {
! 	      error_with_decl (label, "label `%s' used but not defined");
  	      /* Avoid crashing later.  */
  	      define_label (input_location, DECL_NAME (label));
  	    }
  	  else if (warn_unused[UNUSED_LABEL] && !TREE_USED (label))
! 	    warning_with_decl (label, "label `%s' defined but not used");
  	  IDENTIFIER_LABEL_VALUE (DECL_NAME (label)) = 0;
  
  	  /* Put the labels into the "variables" of the
--- 1365,1378 ----
  
  	  if (DECL_INITIAL (label) == 0)
  	    {
! 	      error ("%Hlabel '%D' used but not defined",
!                      &DECL_SOURCE_LOCATION (label), label);
  	      /* Avoid crashing later.  */
  	      define_label (input_location, DECL_NAME (label));
  	    }
  	  else if (warn_unused[UNUSED_LABEL] && !TREE_USED (label))
! 	    warning ("%Hlabel '%D' defined but not used",
!                      &DECL_SOURCE_LOCATION (label), label);
  	  IDENTIFIER_LABEL_VALUE (DECL_NAME (label)) = 0;
  
  	  /* Put the labels into the "variables" of the
*************** force_poplevels (int start_pc)
*** 1497,1505 ****
    while (current_binding_level->start_pc > start_pc)
      {
        if (pedantic && current_binding_level->start_pc > start_pc)
! 	warning_with_decl (current_function_decl, 
! 			   "In %s: overlapped variable and exception ranges at %d",
! 			   current_binding_level->start_pc);
        expand_end_bindings (getdecls (), 1, 0);
        poplevel (1, 0, 0);
      }
--- 1500,1509 ----
    while (current_binding_level->start_pc > start_pc)
      {
        if (pedantic && current_binding_level->start_pc > start_pc)
! 	warning (current_function_decl, 
!                  "%HIn %D: overlapped variable and exception ranges at %d",
!                  &DECL_SOURCE_LOCATION (current_function_decl),
!                  current_function_decl, current_binding_level->start_pc);
        expand_end_bindings (getdecls (), 1, 0);
        poplevel (1, 0, 0);
      }
*************** give_name_to_locals (JCF *jcf)
*** 1584,1591 ****
  	  tree decl = build_decl (VAR_DECL, name, type);
  	  if (end_pc > DECL_CODE_LENGTH (current_function_decl))
  	    {
! 	      warning_with_decl (decl,
! 			 "bad PC range for debug info for local `%s'");
  	      end_pc = DECL_CODE_LENGTH (current_function_decl);
  	    }
  
--- 1588,1595 ----
  	  tree decl = build_decl (VAR_DECL, name, type);
  	  if (end_pc > DECL_CODE_LENGTH (current_function_decl))
  	    {
! 	      warning ("%Hbad PC range for debug info for local '%D'",
!                        &DECL_SOURCE_LOCATION (decl), decl);
  	      end_pc = DECL_CODE_LENGTH (current_function_decl);
  	    }
  
Index: java/expr.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/expr.c,v
retrieving revision 1.168
diff -p -r1.168 expr.c
*** java/expr.c	15 Jul 2003 05:32:21 -0000	1.168
--- java/expr.c	25 Jul 2003 10:25:28 -0000
*************** expand_java_field_op (int is_static, int
*** 2334,2353 ****
        if (FIELD_FINAL (field_decl))
  	{
  	  if (DECL_CONTEXT (field_decl) != current_class)
! 	    error_with_decl (field_decl,
! 		     "assignment to final field `%s' not in field's class");
  	  else if (FIELD_STATIC (field_decl))
  	    {
  	      if (!DECL_CLINIT_P (current_function_decl))
! 		warning_with_decl (field_decl, 
!              "assignment to final static field `%s' not in class initializer");
  	    }
  	  else
  	    {
  	      tree cfndecl_name = DECL_NAME (current_function_decl);
  	      if (! DECL_CONSTRUCTOR_P (current_function_decl)
  		  && !ID_FINIT_P (cfndecl_name))
! 		warning_with_decl (field_decl, "assignment to final field `%s' not in constructor");
  	    }
  	}
        expand_assignment (field_ref, new_value, 0);
--- 2334,2355 ----
        if (FIELD_FINAL (field_decl))
  	{
  	  if (DECL_CONTEXT (field_decl) != current_class)
!             error ("%Hassignment to final field '%D' not in field's class",
!                    &DECL_SOURCE_LOCATION (field_decl), field_decl);
  	  else if (FIELD_STATIC (field_decl))
  	    {
  	      if (!DECL_CLINIT_P (current_function_decl))
! 		warning ("assignment to final static field `%s' not in "
!                          "class initializer",
!                          &DECL_SOURCE_LOCATION (field_decl), field_decl);
  	    }
  	  else
  	    {
  	      tree cfndecl_name = DECL_NAME (current_function_decl);
  	      if (! DECL_CONSTRUCTOR_P (current_function_decl)
  		  && !ID_FINIT_P (cfndecl_name))
!                 warning ("%Hassignment to final field '%D' not in constructor",
!                          &DECL_SOURCE_LOCATION (field_decl),  field_decl);
  	    }
  	}
        expand_assignment (field_ref, new_value, 0);

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