From patchwork Wed Jan 12 09:02:17 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Martin_Li=C5=A1ka?= X-Patchwork-Id: 49903 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 237C9393A419 for ; Wed, 12 Jan 2022 09:02:35 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by sourceware.org (Postfix) with ESMTPS id 4FE483858416 for ; Wed, 12 Jan 2022 09:02:18 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 4FE483858416 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.cz Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 855AF1F385; Wed, 12 Jan 2022 09:02:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1641978137; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Q/L5U2H6Uql79JEv7UZ1xebWO78+yB2qi+x3KLjqgM8=; b=dezAQu6ZioGNeat/MqnApUJq86Fp6BjfBWxJyG4EDaTUMip7flXKPmQwzVr7v0WP2J6ud5 Mjt8o2WrMI8P6G2w/XDxbUkUQ92RIqjpCcsGfspR1H0YYE55q6jLUtCm9xj2iv13+ex61V GLyHCHMlr+/obH5A3pZaveQSD5+ZvJE= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1641978137; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Q/L5U2H6Uql79JEv7UZ1xebWO78+yB2qi+x3KLjqgM8=; b=f+tmnon/3/9D+enpUjoXgpNhMrBpXt8mvNd1SbsFz8FHIrg1qlq3VJ6p+WvCjk9ZkY5bTp ZnEyDxElGkgPXGDQ== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 6F71B13B3D; Wed, 12 Jan 2022 09:02:17 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id KCQMGhmZ3mGgPAAAMHmgww (envelope-from ); Wed, 12 Jan 2022 09:02:17 +0000 Message-ID: <7f10bf55-9109-bbe9-e0a5-80180e325949@suse.cz> Date: Wed, 12 Jan 2022 10:02:17 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.4.1 From: =?utf-8?q?Martin_Li=C5=A1ka?= Subject: [PATCH] Fix -Wformat-diag for aarch64 target. To: gcc-patches@gcc.gnu.org Content-Language: en-US X-Spam-Status: No, score=-11.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" 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 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 %"); 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 % 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 % pragma or attribute"); break; case AARCH64_PARSE_INVALID_ARG: - error ("invalid name (\"%s\") in % pragma or attribute", str); + error ("invalid name (%qs) in % 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 " "% 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 % pragma or attribute"); break; case AARCH64_PARSE_INVALID_ARG: - error ("invalid name (\"%s\") in % pragma or attribute", str); + error ("invalid name (%qs) in % 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 " "% 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 % 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 % pragma or attribute", str); + error ("invalid name (%qs) in % 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 " "% pragma or attribute", invalid_extension.c_str (), str); break;