public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Earnshaw <Richard.Earnshaw@foss.arm.com>
To: "Martin Liška" <mliska@suse.cz>, gcc-patches@gcc.gnu.org
Subject: Re: [PATCH] Fix -Wformat-diag for aarch64 target.
Date: Wed, 12 Jan 2022 11:10:39 +0000	[thread overview]
Message-ID: <46c8edf4-be7f-f081-dd53-dafc473eadf6@foss.arm.com> (raw)
In-Reply-To: <7f10bf55-9109-bbe9-e0a5-80180e325949@suse.cz>



On 12/01/2022 09:02, Martin Liška wrote:
> Hello.
> 
> We've got -Wformat-diag for some time and I think we should start using it
> in -Werror for GCC bootstrap. The following patch removes last pieces of 
> the warning
> for aarch64 target.
> 
> Ready to be installed?
> Thanks,
> Martin

OK.

R.

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

      reply	other threads:[~2022-01-12 11:10 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-12  9:02 Martin Liška
2022-01-12 11:10 ` Richard Earnshaw [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=46c8edf4-be7f-f081-dd53-dafc473eadf6@foss.arm.com \
    --to=richard.earnshaw@foss.arm.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=mliska@suse.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).