From patchwork Fri Dec 9 21:12:47 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Tobias Burnus X-Patchwork-Id: 31926 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp993986wrr; Fri, 9 Dec 2022 13:13:52 -0800 (PST) X-Google-Smtp-Source: AA0mqf6ghZ+tSqoXC5GNvbCEUsJ4LniZlzuDYma4NyH6itHhW1os9kHv+xDojvJ3vT11IwDJrFmj X-Received: by 2002:a17:907:d008:b0:7ae:e154:52f9 with SMTP id va8-20020a170907d00800b007aee15452f9mr7415565ejc.6.1670620432651; Fri, 09 Dec 2022 13:13:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670620432; cv=none; d=google.com; s=arc-20160816; b=t5e98T3/6lgw8mjwwQxYwJA45k5DD2575vNq3GrdNlO1YG52hHoiwwptzhrN9/p6NV ne44I0EPluKDowEZdXv6LVIE0rwpmr+K5ZhIJJat8dt4Zqm5sXtRi7yCntx3/R9fEhJ2 0WoQTjOuxqNjK1b5t8xkApJ65fHE6tL33Ne+QsTxrhnrMKnvMJbImPoW85h4rOAXtPAG +fT06ng+4ThI/UytiYN5rmbZ2TbU94jen/6lv9BtDReF8rxv/eHOT9CjyF/N8Tg7KJm5 Gr2ZZ71Tl2kXmmWvXTezirxvmW+pjFGTpxVvFSrR1EzdWNLIZuQYIg8u28s3qkwcQf4R /fXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:from:to :content-language:user-agent:mime-version:date:message-id :ironport-sdr:dmarc-filter:delivered-to; bh=qPlb7UyIDbGVfN3JxkvnUHEiLXRSvq4VNvPo+Qpwx+8=; b=xykcXJeVhq/91UZZkX8xLKSxm9BNyji25oc5FpK5huEChbNOq9d+b5yytJ5e+JyaWx cZw0peXc5Xrl9IDhdp/yfFQDAeHJ4jvc4fAZhl6pD5tXBRqSQkml5NXOlknN2c9S06cd RP86P7k/mvPxaurjZ990mXyI6zQKy4pYa9m2zRFCTEWFYq2Z3xKaKrng0lU8PTdG7Wn+ 1OU0UKrJa+3SnTvex2yfAASGCXPK6Q8YPVClz+1bMYouzmgQngUkJPF0hVp1f0HJfFLt ejCZV8+zjAtit41m7EjxS7mrCL2Vwo5Eclh6dtS3yXSc/vGSBdA52cpsRfSEISo9ok8F ly4Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id ji5-20020a170907980500b007c0c2ec3683si679523ejc.106.2022.12.09.13.13.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Dec 2022 13:13:52 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 41A8338896E5 for ; Fri, 9 Dec 2022 21:13:30 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from esa4.mentor.iphmx.com (esa4.mentor.iphmx.com [68.232.137.252]) by sourceware.org (Postfix) with ESMTPS id F41E0387220B; Fri, 9 Dec 2022 21:13:02 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org F41E0387220B Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=mentor.com X-IronPort-AV: E=Sophos;i="5.96,232,1665475200"; d="diff'?scan'208";a="89158021" Received: from orw-gwy-01-in.mentorg.com ([192.94.38.165]) by esa4.mentor.iphmx.com with ESMTP; 09 Dec 2022 13:12:54 -0800 IronPort-SDR: MF2nmN9kV/XoLNnVAf+r/Ukv4sHkE7wdlVKN/M+F8C7A11daNJlDc+W3AA+4skt8a51PEDbg0d BaQ4edmdU0QY7J2aCrqx8SZTSfVH9Ww7QFzgc1E1m6jiFRfJZaf2a+1j81sf2R14cGWZsUO+48 f5F84SUM9UlmoMMR7Ygn+f+pMF4m1nus1+TqEVTaloPa56aFFmnB2gHT2RLGsyFbjwVVVqd4Tw dMhuFfdYnifaSgKLZ2zBOIrP3OxoNHEXM2tjc5mX7BqE+IJP5we2m4bkEt5JND8dZVfne0xr2k 4mM= Message-ID: <091af345-e484-7cca-e7df-b31bffbbe293@codesourcery.com> Date: Fri, 9 Dec 2022 22:12:47 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.5.1 Content-Language: en-US To: gcc-patches , fortran From: Tobias Burnus Subject: [Patch] Fortran: Replace simple '.' quotes by %<.%> X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: svr-ies-mbx-09.mgc.mentorg.com (139.181.222.9) To svr-ies-mbx-12.mgc.mentorg.com (139.181.222.12) X-Spam-Status: No, score=-11.4 required=5.0 tests=BAYES_00, GIT_PATCH_0, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) 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+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1751772490993142164?= X-GMAIL-MSGID: =?utf-8?q?1751772490993142164?= Found when working on the just submitted/committed patch. I intent to commit it to mainline as obvious tomorrow (or Sun or Mon), unless there are comments. Tobias ----------------- Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstraße 201, 80634 München; Gesellschaft mit beschränkter Haftung; Geschäftsführer: Thomas Heurung, Frank Thürauf; Sitz der Gesellschaft: München; Registergericht München, HRB 106955 Fortran: Replace simple '.' quotes by %<.%> When using %qs instead of '%s' or %<=%> instead of '=' looks nicer by having nicer quotes and bold text, if the terminal supports it; otherwise, plain quotes are used. gcc/fortran/ChangeLog: * match.cc (gfc_match_member_sep): Use %<...%> in gfc_error. * openmp.cc (gfc_match_oacc_routine, gfc_match_omp_context_selector, gfc_match_omp_context_selector_specification, gfc_match_omp_declare_variant, resolve_omp_clauses): Likewise; use %qs instead of '%s'. * primary.cc (match_real_constant, gfc_match_varspec): Likewise. * resolve.cc (gfc_resolve_formal_arglist, resolve_operator, resolve_ordinary_assign): Likewise. diff --git a/gcc/fortran/match.cc b/gcc/fortran/match.cc index 7ba0f349993..89fb115c0f6 100644 --- a/gcc/fortran/match.cc +++ b/gcc/fortran/match.cc @@ -195,3 +195,3 @@ gfc_match_member_sep(gfc_symbol *sym) gfc_error ("Expected structure component or operator name " - "after '.' at %C"); + "after %<.%> at %C"); goto error; diff --git a/gcc/fortran/openmp.cc b/gcc/fortran/openmp.cc index 4b4e6ac6947..7edc78ad0cb 100644 --- a/gcc/fortran/openmp.cc +++ b/gcc/fortran/openmp.cc @@ -4061,3 +4061,3 @@ gfc_match_oacc_routine (void) gfc_error ("Syntax error in !$ACC ROUTINE ( NAME ) at %C, expecting" - " ')' after NAME"); + " %<)%> after NAME"); gfc_current_locus = old_loc; @@ -5350,4 +5350,4 @@ gfc_match_omp_context_selector (gfc_omp_set_selector *oss) { - gfc_error ("selector '%s' not allowed for context selector " - "set '%s' at %C", + gfc_error ("selector %qs not allowed for context selector " + "set %qs at %C", selector, oss->trait_set_selector_name); @@ -5370,3 +5370,3 @@ gfc_match_omp_context_selector (gfc_omp_set_selector *oss) { - gfc_error ("selector '%s' does not accept any properties at %C", + gfc_error ("selector %qs does not accept any properties at %C", selector); @@ -5379,3 +5379,3 @@ gfc_match_omp_context_selector (gfc_omp_set_selector *oss) { - gfc_error ("expected '(' at %C"); + gfc_error ("expected %<(%> at %C"); return MATCH_ERROR; @@ -5401,3 +5401,3 @@ gfc_match_omp_context_selector (gfc_omp_set_selector *oss) { - gfc_error ("expected ')' at %C"); + gfc_error ("expected %<)%> at %C"); return MATCH_ERROR; @@ -5514,3 +5514,3 @@ gfc_match_omp_context_selector (gfc_omp_set_selector *oss) { - gfc_error ("expected ')' at %C"); + gfc_error ("expected %<)%> at %C"); return MATCH_ERROR; @@ -5524,3 +5524,3 @@ gfc_match_omp_context_selector (gfc_omp_set_selector *oss) { - gfc_error ("expected '(' at %C"); + gfc_error ("expected %<(%> at %C"); return MATCH_ERROR; @@ -5570,4 +5570,4 @@ gfc_match_omp_context_selector_specification (gfc_omp_declare_variant *odv) { - gfc_error ("expected 'construct', 'device', 'implementation' or " - "'user' at %C"); + gfc_error ("expected %, %, % " + "or % at %C"); return MATCH_ERROR; @@ -5578,3 +5578,3 @@ gfc_match_omp_context_selector_specification (gfc_omp_declare_variant *odv) { - gfc_error ("expected '=' at %C"); + gfc_error ("expected %<=%> at %C"); return MATCH_ERROR; @@ -5585,3 +5585,3 @@ gfc_match_omp_context_selector_specification (gfc_omp_declare_variant *odv) { - gfc_error ("expected '{' at %C"); + gfc_error ("expected %<{%> at %C"); return MATCH_ERROR; @@ -5600,3 +5600,3 @@ gfc_match_omp_context_selector_specification (gfc_omp_declare_variant *odv) { - gfc_error ("expected '}' at %C"); + gfc_error ("expected %<}%> at %C"); return MATCH_ERROR; @@ -5622,3 +5622,3 @@ gfc_match_omp_declare_variant (void) { - gfc_error ("expected '(' at %C"); + gfc_error ("expected %<(%> at %C"); return MATCH_ERROR; @@ -5670,3 +5670,3 @@ gfc_match_omp_declare_variant (void) { - gfc_error ("expected ')' at %C"); + gfc_error ("expected %<)%> at %C"); return MATCH_ERROR; @@ -5680,3 +5680,3 @@ gfc_match_omp_declare_variant (void) { - gfc_error ("expected 'match' at %C"); + gfc_error ("expected % at %C"); return MATCH_ERROR; @@ -5689,3 +5689,3 @@ gfc_match_omp_declare_variant (void) { - gfc_error ("expected '(' at %C"); + gfc_error ("expected %<(%> at %C"); return MATCH_ERROR; @@ -5698,3 +5698,3 @@ gfc_match_omp_declare_variant (void) { - gfc_error ("expected ')' at %C"); + gfc_error ("expected %<)%> at %C"); return MATCH_ERROR; @@ -7380,3 +7380,3 @@ resolve_omp_clauses (gfc_code *code, gfc_omp_clauses *omp_clauses, if (n->sym->mark == 1) - gfc_error ("%qs specified in 'allocate' clause at %L but not " + gfc_error ("%qs specified in % clause at %L but not " "in an explicit privatization clause", diff --git a/gcc/fortran/primary.cc b/gcc/fortran/primary.cc index 19f2e78c8ff..21a8eb73c23 100644 --- a/gcc/fortran/primary.cc +++ b/gcc/fortran/primary.cc @@ -588,3 +588,3 @@ match_real_constant (gfc_expr **result, int signflag) { - if (!gfc_notify_std (GFC_STD_GNU, "exponent-letter 'q' in " + if (!gfc_notify_std (GFC_STD_GNU, "exponent-letter % in " "real-literal-constant at %C")) @@ -2072,4 +2072,4 @@ gfc_match_varspec (gfc_expr *primary, int equiv_flag, bool sub_flag, { - gfc_error ("Array section designator, e.g. '(:)', is required " - "besides the coarray designator '[...]' at %C"); + gfc_error ("Array section designator, e.g. %<(:)%>, is required " + "besides the coarray designator %<[...]%> at %C"); return MATCH_ERROR; diff --git a/gcc/fortran/resolve.cc b/gcc/fortran/resolve.cc index 75dc4b59105..5f746d2244a 100644 --- a/gcc/fortran/resolve.cc +++ b/gcc/fortran/resolve.cc @@ -516,3 +516,3 @@ gfc_resolve_formal_arglist (gfc_symbol *proc) shall be specified, explicitly or implicitly, to be scalar. */ - gfc_error ("Argument '%s' of statement function '%s' at %L " + gfc_error ("Argument %qs of statement function %qs at %L " "must be scalar", sym->name, proc->name, @@ -4383,4 +4383,4 @@ resolve_operator (gfc_expr *e) snprintf (msg, sizeof (msg), - _("Unknown operator %%<%s%%> at %%L; did you mean '%s'?"), - name, guessed); + _("Unknown operator %%<%s%%> at %%L; did you mean " + "%%<%s%%>?"), name, guessed); else @@ -8214,3 +8214,3 @@ check_symbols: { - gfc_error ("Expected '*' in coindex specification in ALLOCATE " + gfc_error ("Expected %<*%> in coindex specification in ALLOCATE " "statement at %L", &e->where); @@ -11188,3 +11188,3 @@ resolve_ordinary_assign (gfc_code *code, gfc_namespace *ns) "assignment at %L - check that there is a matching specific " - "subroutine for '=' operator", &lhs->where); + "subroutine for %<=%> operator", &lhs->where); return false;