public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r12-6521] Fix -Wformat-diag for aarch64 target.
@ 2022-01-12 11:55 Martin Liska
  0 siblings, 0 replies; only message in thread
From: Martin Liska @ 2022-01-12 11:55 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:03a1a86b5ee40d4e2402516cbcdf39d981e433b3

commit r12-6521-g03a1a86b5ee40d4e2402516cbcdf39d981e433b3
Author: Martin Liska <mliska@suse.cz>
Date:   Wed Jan 12 09:45:08 2022 +0100

    Fix -Wformat-diag for aarch64 target.
    
    gcc/ChangeLog:
    
            * config/aarch64/aarch64.c (aarch64_parse_boolean_options): Use
            %qs where possible.
            (aarch64_parse_sve_width_string): Likewise.
            (aarch64_override_options_internal): Likewise.
            (aarch64_print_hint_for_extensions): Likewise.
            (aarch64_validate_sls_mitigation): Likewise.
            (aarch64_handle_attr_arch): Likewise.
            (aarch64_handle_attr_cpu): Likewise.
            (aarch64_handle_attr_tune): Likewise.
            (aarch64_handle_attr_isa_flags): Likewise.

Diff:
---
 gcc/config/aarch64/aarch64.c | 26 +++++++++++++-------------
 1 file changed, 13 insertions(+), 13 deletions(-)

diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c
index 5920b29880a..1bca2a31a1b 100644
--- a/gcc/config/aarch64/aarch64.c
+++ b/gcc/config/aarch64/aarch64.c
@@ -16337,7 +16337,7 @@ aarch64_parse_boolean_options (const char *option,
   /* We ended with a comma, print something.  */
   if (!(*specs))
     {
-      error ("%s string ill-formed\n", option_name);
+      error ("%qs string ill-formed", option_name);
       return 0;
     }
 
@@ -16393,7 +16393,7 @@ aarch64_parse_sve_width_string (const char *tune_string,
   int n = sscanf (tune_string, "%d", &width);
   if (n == EOF)
     {
-      error ("invalid format for sve_width");
+      error ("invalid format for %<sve_width%>");
       return;
     }
   switch (width)
@@ -16405,7 +16405,7 @@ aarch64_parse_sve_width_string (const char *tune_string,
     case SVE_2048:
       break;
     default:
-      error ("invalid sve_width value: %d", width);
+      error ("invalid %<sve_width%> value: %d", width);
     }
   tune->sve_width = (enum aarch64_sve_vector_bits_enum) width;
 }
@@ -16628,7 +16628,7 @@ aarch64_override_options_internal (struct gcc_options *opts)
   if (opts->x_aarch64_stack_protector_guard_reg_str)
     {
       if (strlen (opts->x_aarch64_stack_protector_guard_reg_str) > 100)
-	  error ("specify a system register with a small string length.");
+	  error ("specify a system register with a small string length");
     }
 
   if (opts->x_aarch64_stack_protector_guard_offset_str)
@@ -16832,7 +16832,7 @@ aarch64_print_hint_for_extensions (const std::string &str)
     inform (input_location, "valid arguments are: %s;"
 			     " did you mean %qs?", s, hint);
   else
-    inform (input_location, "valid arguments are: %s;", s);
+    inform (input_location, "valid arguments are: %s", s);
 
   XDELETEVEC (s);
 }
@@ -16933,7 +16933,7 @@ aarch64_validate_sls_mitigation (const char *const_str)
 	temp |= SLS_RETBR;
       else if (strcmp (str, "none") == 0 || strcmp (str, "all") == 0)
 	{
-	  error ("%<%s%> must be by itself for %<-mharden-sls=%>", str);
+	  error ("%qs must be by itself for %<-mharden-sls=%>", str);
 	  break;
 	}
       else
@@ -17572,11 +17572,11 @@ aarch64_handle_attr_arch (const char *str)
 	error ("missing name in %<target(\"arch=\")%> pragma or attribute");
 	break;
       case AARCH64_PARSE_INVALID_ARG:
-	error ("invalid name (\"%s\") in %<target(\"arch=\")%> pragma or attribute", str);
+	error ("invalid name (%qs) in %<target(\"arch=\")%> pragma or attribute", str);
 	aarch64_print_hint_for_arch (str);
 	break;
       case AARCH64_PARSE_INVALID_FEATURE:
-	error ("invalid feature modifier %s of value (\"%s\") in "
+	error ("invalid feature modifier %s of value (%qs) in "
 	       "%<target()%> pragma or attribute", invalid_extension.c_str (), str);
 	aarch64_print_hint_for_extensions (invalid_extension);
 	break;
@@ -17614,11 +17614,11 @@ aarch64_handle_attr_cpu (const char *str)
 	error ("missing name in %<target(\"cpu=\")%> pragma or attribute");
 	break;
       case AARCH64_PARSE_INVALID_ARG:
-	error ("invalid name (\"%s\") in %<target(\"cpu=\")%> pragma or attribute", str);
+	error ("invalid name (%qs) in %<target(\"cpu=\")%> pragma or attribute", str);
 	aarch64_print_hint_for_core (str);
 	break;
       case AARCH64_PARSE_INVALID_FEATURE:
-	error ("invalid feature modifier %s of value (\"%s\") in "
+	error ("invalid feature modifier %s of value (%qs) in "
 	       "%<target()%> pragma or attribute", invalid_extension.c_str (), str);
 	aarch64_print_hint_for_extensions (invalid_extension);
 	break;
@@ -17645,7 +17645,7 @@ aarch64_handle_attr_cpu (const char *str)
 	      " attribute");
        break;
      case AARCH64_PARSE_INVALID_ARG:
-       error ("invalid protection type (\"%s\") in %<target(\"branch-protection"
+       error ("invalid protection type (%qs) in %<target(\"branch-protection"
 	      "=\")%> pragma or attribute", err_str);
        break;
      case AARCH64_PARSE_OK:
@@ -17680,7 +17680,7 @@ aarch64_handle_attr_tune (const char *str)
   switch (parse_res)
     {
       case AARCH64_PARSE_INVALID_ARG:
-	error ("invalid name (\"%s\") in %<target(\"tune=\")%> pragma or attribute", str);
+	error ("invalid name (%qs) in %<target(\"tune=\")%> pragma or attribute", str);
 	aarch64_print_hint_for_core (str);
 	break;
       default:
@@ -17725,7 +17725,7 @@ aarch64_handle_attr_isa_flags (char *str)
 	break;
 
       case AARCH64_PARSE_INVALID_FEATURE:
-	error ("invalid feature modifier %s of value (\"%s\") in "
+	error ("invalid feature modifier %s of value (%qs) in "
 	       "%<target()%> pragma or attribute", invalid_extension.c_str (), str);
 	break;


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-01-12 11:55 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-12 11:55 [gcc r12-6521] Fix -Wformat-diag for aarch64 target Martin Liska

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).