public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Jason Merrill <jason@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc/devel/c++-contracts] c++: fix option quoting for -Wformat
Date: Mon, 17 Oct 2022 21:17:03 +0000 (GMT)	[thread overview]
Message-ID: <20221017211703.631B33858036@sourceware.org> (raw)

https://gcc.gnu.org/g:0a35364554de624b0b2b9c25ea52522219574d05

commit 0a35364554de624b0b2b9c25ea52522219574d05
Author: Jason Merrill <jason@redhat.com>
Date:   Mon Oct 17 16:24:55 2022 -0400

    c++: fix option quoting for -Wformat
    
    gcc/cp/ChangeLog:
    
            * contracts.cc (handle_OPT_fcontract_build_level_)
            (handle_OPT_fcontract_assumption_mode_)
            (handle_OPT_fcontract_continuation_mode_)
            (handle_OPT_fcontract_semantic_)
            (handle_OPT_fcontract_role_): Fix option quoting.

Diff:
---
 gcc/cp/contracts.cc | 30 +++++++++++++++---------------
 1 file changed, 15 insertions(+), 15 deletions(-)

diff --git a/gcc/cp/contracts.cc b/gcc/cp/contracts.cc
index 93048f7203d..b1cf2875ce4 100644
--- a/gcc/cp/contracts.cc
+++ b/gcc/cp/contracts.cc
@@ -329,7 +329,7 @@ handle_OPT_fcontract_build_level_ (const char *arg)
 {
   if (contracts_p1332_default || contracts_p1332_review || contracts_p1429)
     {
-      error ("-fcontract-build-level= cannot be mixed with p1332/p1429");
+      error ("%<-fcontract-build-level=%> cannot be mixed with p1332/p1429");
       return;
     }
   else
@@ -342,7 +342,7 @@ handle_OPT_fcontract_build_level_ (const char *arg)
   else if (strcmp (arg, "audit") == 0)
     flag_contract_build_level = AUDIT;
   else
-    error ("-fcontract-build-level= must be off|default|audit");
+    error ("%<-fcontract-build-level=%> must be off|default|audit");
 
   setup_default_contract_role ();
 }
@@ -352,7 +352,7 @@ handle_OPT_fcontract_assumption_mode_ (const char *arg)
 {
   if (contracts_p1332_default || contracts_p1332_review || contracts_p1429)
     {
-      error ("-fcontract-assumption-mode= cannot be mixed with p1332/p1429");
+      error ("%<-fcontract-assumption-mode=%> cannot be mixed with p1332/p1429");
       return;
     }
   else
@@ -363,7 +363,7 @@ handle_OPT_fcontract_assumption_mode_ (const char *arg)
   else if (strcmp (arg, "off") == 0)
     flag_contract_assumption_mode = false;
   else
-    error ("-fcontract-assumption-mode= must be %<on%> or %<off%>");
+    error ("%<-fcontract-assumption-mode=%> must be %<on%> or %<off%>");
 
   setup_default_contract_role ();
 }
@@ -373,7 +373,7 @@ handle_OPT_fcontract_continuation_mode_ (const char *arg)
 {
   if (contracts_p1332_default || contracts_p1332_review || contracts_p1429)
     {
-      error ("-fcontract-continuation-mode= cannot be mixed with p1332/p1429");
+      error ("%<-fcontract-continuation-mode=%> cannot be mixed with p1332/p1429");
       return;
     }
   else
@@ -384,7 +384,7 @@ handle_OPT_fcontract_continuation_mode_ (const char *arg)
   else if (strcmp (arg, "off") == 0)
     flag_contract_continuation_mode = false;
   else
-    error ("-fcontract-continuation-mode= must be %<on%> or %<off%>");
+    error ("%<-fcontract-continuation-mode=%> must be %<on%> or %<off%>");
 
   setup_default_contract_role ();
 }
@@ -396,7 +396,7 @@ handle_OPT_fcontract_role_ (const char *arg)
   const char *vals = strchr (name, ':');
   if (vals == NULL)
     {
-      error ("-fcontract-role= must be in the form role:semantics");
+      error ("%<-fcontract-role=%> must be in the form role:semantics");
       return;
     }
 
@@ -407,7 +407,7 @@ handle_OPT_fcontract_role_ (const char *arg)
   aus = strchr (des, ',');
   if (aus == NULL)
     {
-      error ("-fcontract-role= semantics must include default,audit,axiom values");
+      error ("%<-fcontract-role=%> semantics must include default,audit,axiom values");
       goto validate;
     }
   *aus = '\0'; // null terminate des
@@ -416,7 +416,7 @@ handle_OPT_fcontract_role_ (const char *arg)
   axs = strchr (aus, ',');
   if (axs == NULL)
     {
-      error ("-fcontract-role= semantics must include default,audit,axiom values");
+      error ("%<-fcontract-role=%> semantics must include default,audit,axiom values");
       goto validate;
     }
   *axs = '\0'; // null terminate aus
@@ -435,7 +435,7 @@ validate:
   bool is_std_role = is_defalult_role || is_review_role;
   if ((contracts_std && is_std_role) || (contracts_p1429 && is_defalult_role))
     {
-      error ("-fcontract-role= cannot be mixed with std/p1429 contract flags");
+      error ("%<-fcontract-role=%> cannot be mixed with std/p1429 contract flags");
       return;
     }
   else if (is_std_role)
@@ -449,7 +449,7 @@ validate:
   if (role == NULL)
     {
       // TODO: not enough space?
-      error ("-fcontract-level= too many custom roles");
+      error ("%<-fcontract-level=%> too many custom roles");
       return;
     }
   else
@@ -461,13 +461,13 @@ handle_OPT_fcontract_semantic_ (const char *arg)
 {
   if (!strchr (arg, ':'))
     {
-      error ("-fcontract-semantic= must be in the form level:semantic");
+      error ("%<-fcontract-semantic=%> must be in the form level:semantic");
       return;
     }
 
   if (contracts_std || contracts_p1332_default)
     {
-      error ("-fcontract-semantic= cannot be mixed with std/p1332 contract flags");
+      error ("%<-fcontract-semantic=%> cannot be mixed with std/p1332 contract flags");
       return;
     }
   contracts_p1429 = true;
@@ -475,7 +475,7 @@ handle_OPT_fcontract_semantic_ (const char *arg)
   contract_role *role = get_contract_role ("default");
   if (!role)
     {
-      error ("-fcontract-semantic= cannot find default role");
+      error ("%<-fcontract-semantic=%> cannot find default role");
       return;
     }
 
@@ -491,7 +491,7 @@ handle_OPT_fcontract_semantic_ (const char *arg)
   else if (strncmp ("axiom:", arg, 6) == 0)
     role->axiom_semantic = sem;
   else
-    error ("-fcontract-semantic= level must be default, audit, or axiom");
+    error ("%<-fcontract-semantic=%> level must be default, audit, or axiom");
   validate_contract_role (role);
 }

                 reply	other threads:[~2022-10-17 21:17 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20221017211703.631B33858036@sourceware.org \
    --to=jason@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.org \
    /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).