From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2122) id 631B33858036; Mon, 17 Oct 2022 21:17:03 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 631B33858036 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1666041423; bh=MaNGStmhSd2T9bF61rRtee82oyWgjrYtOv1S0FoYdYg=; h=From:To:Subject:Date:From; b=KZPAdM/IRcrnxaiTVfz3aw2eUkQIyiwF0Jz4bofl1iU0oyU1jbk42KxCjCiUGab7G O4JqFKBYAdSwLwKFPiI1rJ5ZGO9tSJvbwG8pEIGE2xSm0OG8ZSI5DXBSn4oVPup+hx JJtMyuuKkz5A6JgHPOsYtnNe6biumV8cO4o43A1A= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Jason Merrill To: gcc-cvs@gcc.gnu.org Subject: [gcc/devel/c++-contracts] c++: fix option quoting for -Wformat X-Act-Checkin: gcc X-Git-Author: Jason Merrill X-Git-Refname: refs/heads/devel/c++-contracts X-Git-Oldrev: 99e1cabe020ca94e63008f1b5f7e0a7df11b4cfc X-Git-Newrev: 0a35364554de624b0b2b9c25ea52522219574d05 Message-Id: <20221017211703.631B33858036@sourceware.org> Date: Mon, 17 Oct 2022 21:17:03 +0000 (GMT) List-Id: https://gcc.gnu.org/g:0a35364554de624b0b2b9c25ea52522219574d05 commit 0a35364554de624b0b2b9c25ea52522219574d05 Author: Jason Merrill 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 % or %"); + error ("%<-fcontract-assumption-mode=%> must be % or %"); 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 % or %"); + error ("%<-fcontract-continuation-mode=%> must be % or %"); 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); }