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 2/7] clean up quoting problems - gcc (PR 80280 et al.)


The attached patch adds missing quoting to diagnostic directives
in files in the top-level gcc/ directory.

Martin
gcc/ChangeLog:

	* builtins.c (expand_builtin_object_size): Add missing quoting to
	%D and like directives.
	* hsa-gen.c (hsa_type_for_scalar_tree_type): Same.
	(hsa_type_for_tree_type): Same.
	(verify_function_arguments): Same.
	* symtab.c (symbol_table::change_decl_assembler_name): Same.
	* varasm.c (get_section): Same.
	(mark_weak): Same.


diff --git a/gcc/builtins.c b/gcc/builtins.c
index f3bee5b..5567fd2 100644
--- a/gcc/builtins.c
+++ b/gcc/builtins.c
@@ -9493,7 +9493,7 @@ expand_builtin_object_size (tree exp)
 
   if (!validate_arglist (exp, POINTER_TYPE, INTEGER_TYPE, VOID_TYPE))
     {
-      error ("%Kfirst argument of %D must be a pointer, second integer constant",
+      error ("%Kfirst argument of %qD must be a pointer, second integer constant",
 	     exp, fndecl);
       expand_builtin_trap ();
       return const0_rtx;
@@ -9506,7 +9506,7 @@ expand_builtin_object_size (tree exp)
       || tree_int_cst_sgn (ost) < 0
       || compare_tree_int (ost, 3) > 0)
     {
-      error ("%Klast argument of %D is not integer constant between 0 and 3",
+      error ("%Klast argument of %qD is not integer constant between 0 and 3",
 	     exp, fndecl);
       expand_builtin_trap ();
       return const0_rtx;
diff --git a/gcc/hsa-gen.c b/gcc/hsa-gen.c
index 7b69d64..4b85e0b 100644
--- a/gcc/hsa-gen.c
+++ b/gcc/hsa-gen.c
@@ -587,7 +587,7 @@ hsa_type_for_scalar_tree_type (const_tree type, bool min32int)
     {
       HSA_SORRY_ATV (EXPR_LOCATION (type),
 		     "support for HSA does not implement huge or "
-		     "variable-sized type %T", type);
+		     "variable-sized type %qT", type);
       return res;
     }
 
@@ -616,7 +616,7 @@ hsa_type_for_scalar_tree_type (const_tree type, bool min32int)
   if (res == BRIG_TYPE_NONE)
     {
       HSA_SORRY_ATV (EXPR_LOCATION (type),
-		     "support for HSA does not implement type %T", type);
+		     "support for HSA does not implement type %qT", type);
       return res;
     }
 
@@ -628,7 +628,7 @@ hsa_type_for_scalar_tree_type (const_tree type, bool min32int)
 	{
 	  HSA_SORRY_ATV (EXPR_LOCATION (type),
 			 "support for HSA does not implement a vector type "
-			 "where a type and unit size are equal: %T", type);
+			 "where a type and unit size are equal: %qT", type);
 	  return res;
 	}
 
@@ -645,7 +645,7 @@ hsa_type_for_scalar_tree_type (const_tree type, bool min32int)
 	  break;
 	default:
 	  HSA_SORRY_ATV (EXPR_LOCATION (type),
-			 "support for HSA does not implement type %T", type);
+			 "support for HSA does not implement type %qT", type);
 	}
     }
 
@@ -704,7 +704,7 @@ hsa_type_for_tree_type (const_tree type, unsigned HOST_WIDE_INT *dim_p = NULL,
   if (!tree_fits_uhwi_p (TYPE_SIZE_UNIT (type)))
     {
       HSA_SORRY_ATV (EXPR_LOCATION (type), "support for HSA does not "
-		     "implement huge or variable-sized type %T", type);
+		     "implement huge or variable-sized type %qT", type);
       return BRIG_TYPE_NONE;
     }
 
@@ -732,8 +732,8 @@ hsa_type_for_tree_type (const_tree type, unsigned HOST_WIDE_INT *dim_p = NULL,
 	      || !tree_fits_shwi_p (TYPE_MAX_VALUE (domain)))
 	    {
 	      HSA_SORRY_ATV (EXPR_LOCATION (type),
-			     "support for HSA does not implement array %T with "
-			     "unknown bounds", type);
+			     "support for HSA does not implement array "
+			     "%qT with unknown bounds", type);
 	      return BRIG_TYPE_NONE;
 	    }
 	  HOST_WIDE_INT min = tree_to_shwi (TYPE_MIN_VALUE (domain));
@@ -3485,14 +3485,14 @@ verify_function_arguments (tree decl)
   if (DECL_STATIC_CHAIN (decl))
     {
       HSA_SORRY_ATV (EXPR_LOCATION (decl),
-		     "HSA does not support nested functions: %D", decl);
+		     "HSA does not support nested functions: %qD", decl);
       return;
     }
   else if (!TYPE_ARG_TYPES (type) || stdarg_p (type))
     {
       HSA_SORRY_ATV (EXPR_LOCATION (decl),
 		     "HSA does not support functions with variadic arguments "
-		     "(or unknown return type): %D", decl);
+		     "(or unknown return type): %qD", decl);
       return;
     }
 }
diff --git a/gcc/symtab.c b/gcc/symtab.c
index 342cc36..6c41dcf 100644
--- a/gcc/symtab.c
+++ b/gcc/symtab.c
@@ -296,7 +296,7 @@ symbol_table::change_decl_assembler_name (tree decl, tree name)
       const char *old_name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl));
       if (TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (decl))
 	  && DECL_RTL_SET_P (decl))
-	warning (0, "%D renamed after being referenced in assembly", decl);
+	warning (0, "%qD renamed after being referenced in assembly", decl);
 
       SET_DECL_ASSEMBLER_NAME (decl, name);
       if (alias)
diff --git a/gcc/varasm.c b/gcc/varasm.c
index 05e48a5..096871d 100644
--- a/gcc/varasm.c
+++ b/gcc/varasm.c
@@ -320,15 +320,15 @@ get_section (const char *name, unsigned int flags, tree decl)
 	      && decl != sect->named.decl)
 	    {
 	      if (decl != NULL && DECL_P (decl))
-		error ("%+D causes a section type conflict with %D",
+		error ("%+qD causes a section type conflict with %qD",
 		       decl, sect->named.decl);
 	      else
-		error ("section type conflict with %D", sect->named.decl);
+		error ("section type conflict with %qD", sect->named.decl);
 	      inform (DECL_SOURCE_LOCATION (sect->named.decl),
 		      "%qD was declared here", sect->named.decl);
 	    }
 	  else if (decl != NULL && DECL_P (decl))
-	    error ("%+D causes a section type conflict", decl);
+	    error ("%+qD causes a section type conflict", decl);
 	  else
 	    error ("section type conflict");
 	  /* Make sure we don't error about one section multiple times.  */
@@ -5383,7 +5383,7 @@ mark_weak (tree decl)
 
   struct symtab_node *n = symtab_node::get (decl);
   if (n && n->refuse_visibility_changes)
-    error ("%+D declared weak after being used", decl);
+    error ("%+qD declared weak after being used", decl);
   DECL_WEAK (decl) = 1;
 
   if (DECL_RTL_SET_P (decl)

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