diff mbox series

[Ada] Replace ? with ?? in warning messages

Message ID 1869364.yKVeVyVuyW@fomalhaut
State New
Headers show
Series [Ada] Replace ? with ?? in warning messages | expand

Commit Message

Eric Botcazou May 21, 2021, 9:15 a.m. UTC
The former has been deprecated in favor of the latter.

Tested on x86-64/Linux, applied on the mainline.


2021-05-21  Ghjuvan Lacambre  <lacambre@adacore.com>

	* gcc-interface/decl.c (gnat_to_gnu_entity): Replace ? with ??.
	(gnat_to_gnu_param): Likewise.
	(gnat_to_gnu_subprog_type): Likewise.
	(warn_on_field_placement): Likewise.
	(intrin_arglists_compatible_p): Likewise.
	* gcc-interface/trans.c (Pragma_to_gnu): Likewise.
	(gnat_to_gnu): Likewise.
	(validate_unchecked_conversion): Likewise.
	* gcc-interface/utils.c (maybe_pad_type): Likewise.
diff mbox series

Patch

diff --git a/gcc/ada/gcc-interface/decl.c b/gcc/ada/gcc-interface/decl.c
index 8d3c16c624b..c7d61763db1 100644
--- a/gcc/ada/gcc-interface/decl.c
+++ b/gcc/ada/gcc-interface/decl.c
@@ -1392,7 +1392,7 @@  gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, bool definition)
 
 		if (TREE_CODE (TYPE_SIZE_UNIT (gnu_alloc_type)) == INTEGER_CST
 		    && !valid_constant_size_p (TYPE_SIZE_UNIT (gnu_alloc_type)))
-		  post_error ("?`Storage_Error` will be raised at run time!",
+		  post_error ("??`Storage_Error` will be raised at run time!",
 			      gnat_entity);
 
 		gnu_expr
@@ -4328,7 +4328,7 @@  gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, bool definition)
 		 ratio is greater or equal to the byte/bit ratio.  */
 	      if (tree_fits_uhwi_p (size)
 		  && align >= tree_to_uhwi (size) * BITS_PER_UNIT)
-		post_error_ne ("?suspiciously large alignment specified for&",
+		post_error_ne ("??suspiciously large alignment specified for&",
 			       Expression (Alignment_Clause (gnat_entity)),
 			       gnat_entity);
 	    }
@@ -5443,7 +5443,7 @@  gnat_to_gnu_param (Entity_Id gnat_param, tree gnu_param_type, bool first,
   input_location = saved_location;
 
   if (mech == By_Copy && (by_ref || by_component_ptr))
-    post_error ("?cannot pass & by copy", gnat_param);
+    post_error ("??cannot pass & by copy", gnat_param);
 
   /* If this is an Out parameter that isn't passed by reference and whose
      type doesn't require the initialization of formals, we don't make a
@@ -6271,7 +6271,7 @@  gnat_to_gnu_subprog_type (Entity_Id gnat_subprog, bool definition,
 
 	      if (!intrin_profiles_compatible_p (&inb))
 		post_error
-		  ("?profile of& doesn''t match the builtin it binds!",
+		  ("??profile of& doesn''t match the builtin it binds!",
 		   gnat_subprog);
 
 	      return gnu_builtin_decl;
@@ -6284,7 +6284,7 @@  gnat_to_gnu_subprog_type (Entity_Id gnat_subprog, bool definition,
 	     on demand without risking false positives with common default sets
 	     of options.  */
 	  if (warn_shadow)
-	    post_error ("?gcc intrinsic not found for&!", gnat_subprog);
+	    post_error ("??gcc intrinsic not found for&!", gnat_subprog);
 	}
     }
 
@@ -7597,20 +7597,20 @@  warn_on_field_placement (tree gnu_field, Node_Id gnat_component_list,
 
   const char *msg1
     = in_variant
-      ? "?variant layout may cause performance issues"
-      : "?record layout may cause performance issues";
+      ? "??variant layout may cause performance issues"
+      : "??record layout may cause performance issues";
   const char *msg2
     = Ekind (gnat_field) == E_Discriminant
-      ? "?discriminant & whose length is not multiple of a byte"
+      ? "??discriminant & whose length is not multiple of a byte"
       : field_has_self_size (gnu_field)
-	? "?component & whose length depends on a discriminant"
+	? "??component & whose length depends on a discriminant"
 	: field_has_variable_size (gnu_field)
-	  ? "?component & whose length is not fixed"
-	  : "?component & whose length is not multiple of a byte";
+	  ? "??component & whose length is not fixed"
+	  : "??component & whose length is not multiple of a byte";
   const char *msg3
     = do_reorder
-      ? "?comes too early and was moved down"
-      : "?comes too early and ought to be moved down";
+      ? "??comes too early and was moved down"
+      : "??comes too early and ought to be moved down";
 
   post_error (msg1, gnat_field);
   post_error_ne (msg2, gnat_field, gnat_field);
@@ -9481,14 +9481,14 @@  intrin_arglists_compatible_p (intrin_binding_t * inb)
       if (ada_type == void_type_node
 	  && btin_type != void_type_node)
 	{
-	  post_error ("?Ada arguments list too short!", inb->gnat_entity);
+	  post_error ("??Ada arguments list too short!", inb->gnat_entity);
 	  return false;
 	}
 
       if (btin_type == void_type_node
 	  && ada_type != void_type_node)
 	{
-	  post_error_ne_num ("?Ada arguments list too long ('> ^)!",
+	  post_error_ne_num ("??Ada arguments list too long ('> ^)!",
 			     inb->gnat_entity, inb->gnat_entity, argpos);
 	  return false;
 	}
@@ -9497,7 +9497,7 @@  intrin_arglists_compatible_p (intrin_binding_t * inb)
       argpos ++;
       if (intrin_types_incompatible_p (ada_type, btin_type))
 	{
-	  post_error_ne_num ("?intrinsic binding type mismatch on argument ^!",
+	  post_error_ne_num ("??intrinsic binding type mismatch on argument ^!",
 			     inb->gnat_entity, inb->gnat_entity, argpos);
 	  return false;
 	}
@@ -9528,7 +9528,7 @@  intrin_return_compatible_p (intrin_binding_t * inb)
      handles void/void as well.  */
   if (intrin_types_incompatible_p (btin_return_type, ada_return_type))
     {
-      post_error ("?intrinsic binding type mismatch on return value!",
+      post_error ("??intrinsic binding type mismatch on return value!",
 		  inb->gnat_entity);
       return false;
     }
diff --git a/gcc/ada/gcc-interface/trans.c b/gcc/ada/gcc-interface/trans.c
index adbbbb11aea..289a2efcaf1 100644
--- a/gcc/ada/gcc-interface/trans.c
+++ b/gcc/ada/gcc-interface/trans.c
@@ -1453,17 +1453,17 @@  Pragma_to_gnu (Node_Id gnat_node)
 	{
 	case Name_Off:
 	  if (optimize)
-	    post_error ("must specify -O0?", gnat_node);
+	    post_error ("must specify -O0??", gnat_node);
 	  break;
 
 	case Name_Space:
 	  if (!optimize_size)
-	    post_error ("must specify -Os?", gnat_node);
+	    post_error ("must specify -Os??", gnat_node);
 	  break;
 
 	case Name_Time:
 	  if (!optimize)
-	    post_error ("insufficient -O value?", gnat_node);
+	    post_error ("insufficient -O value??", gnat_node);
 	  break;
 
 	default:
@@ -1473,7 +1473,7 @@  Pragma_to_gnu (Node_Id gnat_node)
 
     case Pragma_Reviewable:
       if (write_symbols == NO_DEBUG)
-	post_error ("must specify -g?", gnat_node);
+	post_error ("must specify -g??", gnat_node);
       break;
 
     case Pragma_Warning_As_Error:
@@ -1574,17 +1574,17 @@  Pragma_to_gnu (Node_Id gnat_node)
 	    option_index = find_opt (option_string + 1, lang_mask);
 	    if (option_index == OPT_SPECIAL_unknown)
 	      {
-		post_error ("?unknown -W switch", gnat_node);
+		post_error ("unknown -W switch??", gnat_node);
 		break;
 	      }
 	    else if (!(cl_options[option_index].flags & CL_WARNING))
 	      {
-		post_error ("?-W switch does not control warning", gnat_node);
+		post_error ("-W switch does not control warning??", gnat_node);
 		break;
 	      }
 	    else if (!(cl_options[option_index].flags & lang_mask))
 	      {
-		post_error ("?-W switch not valid for Ada", gnat_node);
+		post_error ("-W switch not valid for Ada??", gnat_node);
 		break;
 	      }
 	    if (cl_options[option_index].flags & CL_JOINED)
@@ -6970,7 +6970,7 @@  gnat_to_gnu (Node_Id gnat_node)
 
 	  if (align != 0 && align < oalign && !TYPE_ALIGN_OK (gnu_obj_type))
 	    post_error_ne_tree_2
-	      ("?source alignment (^) '< alignment of & (^)",
+	      ("??source alignment (^) '< alignment of & (^)",
 	       gnat_node, Designated_Type (Etype (gnat_node)),
 	       size_int (align / BITS_PER_UNIT), oalign / BITS_PER_UNIT);
 	}
@@ -8285,7 +8285,7 @@  gnat_to_gnu (Node_Id gnat_node)
   /* If the result is a constant that overflowed, raise Constraint_Error.  */
   if (TREE_CODE (gnu_result) == INTEGER_CST && TREE_OVERFLOW (gnu_result))
     {
-      post_error ("?`Constraint_Error` will be raised at run time", gnat_node);
+      post_error ("??`Constraint_Error` will be raised at run time", gnat_node);
       gnu_result
 	= build1 (NULL_EXPR, gnu_result_type,
 		  build_call_raise (CE_Overflow_Check_Failed, gnat_node,
@@ -10322,7 +10322,7 @@  validate_unchecked_conversion (Node_Id gnat_node)
 	      || !alias_sets_conflict_p (get_alias_set (gnu_source_desig_type),
 					 target_alias_set)))
 	{
-	  post_error_ne ("?possible aliasing problem for type&",
+	  post_error_ne ("??possible aliasing problem for type&",
 			 gnat_node, Target_Type (gnat_node));
 	  post_error ("\\?use -fno-strict-aliasing switch for references",
 		      gnat_node);
@@ -10348,7 +10348,7 @@  validate_unchecked_conversion (Node_Id gnat_node)
 	      || !alias_sets_conflict_p (get_alias_set (gnu_source_desig_type),
 					 target_alias_set)))
 	{
-	  post_error_ne ("?possible aliasing problem for type&",
+	  post_error_ne ("??possible aliasing problem for type&",
 			 gnat_node, Target_Type (gnat_node));
 	  post_error ("\\?use -fno-strict-aliasing switch for references",
 		      gnat_node);
diff --git a/gcc/ada/gcc-interface/utils.c b/gcc/ada/gcc-interface/utils.c
index 8539fe497e1..8de85991663 100644
--- a/gcc/ada/gcc-interface/utils.c
+++ b/gcc/ada/gcc-interface/utils.c
@@ -1721,11 +1721,11 @@  built:
       if (Comes_From_Source (gnat_entity))
 	{
 	  if (is_component_type)
-	    post_error_ne_tree ("component of& padded{ by ^ bits}?",
+	    post_error_ne_tree ("component of& padded{ by ^ bits}??",
 				gnat_entity, gnat_entity,
 				size_diffop (size, orig_size));
 	  else if (Present (gnat_error_node))
-	    post_error_ne_tree ("{^ }bits of & unused?",
+	    post_error_ne_tree ("{^ }bits of & unused??",
 				gnat_error_node, gnat_entity,
 				size_diffop (size, orig_size));
 	}