From patchwork Tue Feb 13 02:11:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Malcolm X-Patchwork-Id: 200189 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:bc8a:b0:106:860b:bbdd with SMTP id dn10csp283182dyb; Mon, 12 Feb 2024 18:11:59 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVb8XLjc/e5bDcbBHWdmwtRMrrzBeBtaZudJvxzDn3OE4I8sNyhAHa5hqqFr5ZJqapQfW0EV9x5f9N1eZGGf1k8KZ3sDg== X-Google-Smtp-Source: AGHT+IGv0gAQ2pPabpsj3EXYb4jhXsTqVkOQb/6MBJFEL1BzV/yIV13SbNWSxwMCPmQghljFwJG4 X-Received: by 2002:a0c:f050:0:b0:68c:3f60:f09a with SMTP id b16-20020a0cf050000000b0068c3f60f09amr6654961qvl.47.1707790319375; Mon, 12 Feb 2024 18:11:59 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707790319; cv=pass; d=google.com; s=arc-20160816; b=PkNy9q2EbQg/Ibn/z7xOe49YMVaCL2nFFgnc5sgT69R354qRSJJq0uiGqHDNjgrEUh jh/DbyrhWjHZP56JGxOE3bYwVSw8ErPz9+a24y4vi0IsZf7VrjSvpt3FhtBqjZAeS4UY ZODnjkwlUlFxpW8WJQV8g0zOn2Dnu9zaXiniY1J01Z7vH0Z0AFzxAiJgHspE5D+8aBYx yvermHtiZpe5ylsfoOhHjT1vKtAnNy7/Ovb6tBUSDsYK5kJ1UoU4HL1ZNBuzbjRtIAQw QpbhLLBBxbPujV2qcnZO0UOpA1XbfSUaBjXZqdtL2Mj+KtvxEX8UwpDGBxei0/dPVGh2 801w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature:arc-filter:dmarc-filter:delivered-to; bh=+0jeQtQ8B1tt/3l1B5Z1eNjdEH7nQk/+TSVGZO5OXtQ=; fh=hwHmZwg3xuPMsvyDNXgEM2oaAQnNJldDEogdI5uxiLs=; b=ICz9hJhGlmdj2Sjg562RTwxUY0Owx+gZqn+xDMQWdzkwZwr9zBCw6dwkse2Y4ykS7p sBW207Kn9znofaX/SHuOQMjrT2kon19DUrRIZQyftFECyCbMd8hEiGzrkskZKg3TQCaQ cNa+195tGfpyTef1DPUy4UWc2bINQ35DRwO0OUzTgox2dUHw8bENU3TfGWeTW5HOe5uN 8VJMtpElMRjvFbjzB8wvoZIH86clnK35rDCiuTTuv9biXY0c92V/sKqeoa4vOV+YBVKA 0J6phw9Kmk7J0lb0VcMyDtuh+k6keRZN+CkAz7aHS3L7n20vpPiRwxa3PJbbdBs6evw9 BR6A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Z+Ym1kVc; arc=pass (i=1); 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"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com X-Forwarded-Encrypted: i=2; AJvYcCXJujPULr3Ss1Hgqqu//34ElMZoCx2/WrrLcrvyAkTtBNggQuE+JojCd4BPY+DC46/Z3+G9k5JtLbVdGFu3Eo7x308rNw== Received: from server2.sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id gv13-20020a056214262d00b0068c4ff28befsi1910314qvb.202.2024.02.12.18.11.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Feb 2024 18:11:59 -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; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Z+Ym1kVc; arc=pass (i=1); 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"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 0C73D3858C52 for ; Tue, 13 Feb 2024 02:11:59 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 1F12E3858C52 for ; Tue, 13 Feb 2024 02:11:09 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 1F12E3858C52 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 1F12E3858C52 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1707790270; cv=none; b=k6Lg3n8QckLtynDo/sl+DQt21J0V+8Py1ebtOt5Fu6475Qd0JC2dESMqJr/yOnHqKbcfMNTcQTFZwbXxeX++yZj3UUPhO0XdXF14f5IM2QrbOjErb2Hz1pCCWle6nbMRZhFVZuAH0nVa/jxwzLB/ccR8cuaQ8T7EUwkSIhoyTm0= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1707790270; c=relaxed/simple; bh=kdybQJsSP720+85nWg43e1KKU3UlAx67cUP6vXQSTaA=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=RuilxKRRbQsEG7mbaFm/PazthZeOqflp5gaNc2VPL9meFMMjY4RuNXR6hhZ79RUoMNj72MWA5S5i4TD2USfzijh+BvZ3VPA9+kpxIqzcCKoNN18UcsSHPhrl+10MjksA+IVOc94iJNce3d3mXZI5CzxrpjxozSS5D2VgGproyHY= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1707790268; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+0jeQtQ8B1tt/3l1B5Z1eNjdEH7nQk/+TSVGZO5OXtQ=; b=Z+Ym1kVcegR4yRfDcVSG+epA4rZK8dMnRdAYnRjOWH35HXaUqMnmSJxREZZT4UFUFVW/HB /W5ffQHK4lWm2ffxuZvetRFW16rErob5TuG+nS/PBfhcCLeXiM8iDIORvpSxhsuVZKfFPK HfuyZwJ3cvzsoNqpAH6uUkHjuhKYruc= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-664-bW3PRyMFPreuA0egnxxhZQ-1; Mon, 12 Feb 2024 21:11:07 -0500 X-MC-Unique: bW3PRyMFPreuA0egnxxhZQ-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id E20D2101A52A for ; Tue, 13 Feb 2024 02:11:06 +0000 (UTC) Received: from t14s.localdomain.com (unknown [10.22.32.119]) by smtp.corp.redhat.com (Postfix) with ESMTP id B053E2166B31; Tue, 13 Feb 2024 02:11:06 +0000 (UTC) From: David Malcolm To: Joseph Myers Cc: gcc-patches@gcc.gnu.org, David Malcolm Subject: [pushed] diagnostics: unbreak 'make gcc.pot' Date: Mon, 12 Feb 2024 21:11:05 -0500 Message-Id: <20240213021105.2640329-1-dmalcolm@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.6 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-11.8 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE 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.30 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 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790747941915649913 X-GMAIL-MSGID: 1790747941915649913 On Fri, 2024-02-09 at 16:53 +0000, Joseph Myers wrote: > On Fri, 1 Dec 2023, David Malcolm wrote: > > * diagnostic-core.h (emit_diagnostic_valist): New overload > decl. > > This has broken regeneration of gcc.pot (overloads can't have the > message > extracted for translation in different argument positions). > > emit_diagnostic_valist used incompatibly as both > --keyword=emit_diagnostic_valist:4 > --flag=emit_diagnostic_valist:4:gcc-internal-format and > --keyword=emit_diagnostic_valist:5 > --flag=emit_diagnostic_valist:5:gcc-internal-format > > See commit 6c8e584430bc5dc01b4438f3c38a2a10fcba7685 for previous > fixes for > this involving the same function, or > 40fecdd62f7d293a214dd71b81de5e0f1099bba7 and > db30e21cbff7b9b2acd13ab83e25e3bf52f9696f for older fixes for similar > issues. Sorry about this; should be fixed by the following patch. Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu. Verified that "make gcc.pot" succeeds with the patch. Pushed to trunk as r14-8946-gb753ef8f0c1d9c. As noted by Joseph, I broke "make gcc.pot" in r14-6057-g12b67d1e13b3cf by adding an overloaded format API with the format string in a different position, leading to this failure: emit_diagnostic_valist used incompatibly as both --keyword=emit_diagnostic_valist:4 --flag=emit_diagnostic_valist:4:gcc-internal-format and --keyword=emit_diagnostic_valist:5 --flag=emit_diagnostic_valist:5:gcc-internal-format Fix by replacing the overloaded function with one with a different name. See also r10-6297-g6c8e584430bc5d for previous fixes for this involving the same function, or r5-6946-g40fecdd62f7d29 and r5-6959-gdb30e21cbff7b9 for older fixes for similar issues. gcc/analyzer/ChangeLog: * pending-diagnostic.cc (diagnostic_emission_context::warn): Update for renaming of emit_diagnostic_valist overload to emit_diagnostic_valist_meta. (diagnostic_emission_context::inform): Likewise. gcc/ChangeLog: * diagnostic-core.h (emit_diagnostic_valist): Rename overload to... (emit_diagnostic_valist_meta): ...this. * diagnostic.cc (emit_diagnostic_valist): Likewise, to... (emit_diagnostic_valist_meta): ...this. Signed-off-by: David Malcolm --- gcc/analyzer/pending-diagnostic.cc | 16 ++++++++-------- gcc/diagnostic-core.h | 12 ++++++------ gcc/diagnostic.cc | 10 +++++----- 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/gcc/analyzer/pending-diagnostic.cc b/gcc/analyzer/pending-diagnostic.cc index e49aaa5a6d9..b2961c21bfc 100644 --- a/gcc/analyzer/pending-diagnostic.cc +++ b/gcc/analyzer/pending-diagnostic.cc @@ -129,10 +129,10 @@ diagnostic_emission_context::warn (const char *gmsgid, ...) auto_diagnostic_group d; va_list ap; va_start (ap, gmsgid); - const bool result = emit_diagnostic_valist (DK_WARNING, - &m_rich_loc, &m_metadata, - pd.get_controlling_option (), - gmsgid, &ap); + const bool result = emit_diagnostic_valist_meta (DK_WARNING, + &m_rich_loc, &m_metadata, + pd.get_controlling_option (), + gmsgid, &ap); va_end (ap); return result; } @@ -147,10 +147,10 @@ diagnostic_emission_context::inform (const char *gmsgid, ...) auto_diagnostic_group d; va_list ap; va_start (ap, gmsgid); - emit_diagnostic_valist (DK_NOTE, - &m_rich_loc, &m_metadata, - pd.get_controlling_option (), - gmsgid, &ap); + emit_diagnostic_valist_meta (DK_NOTE, + &m_rich_loc, &m_metadata, + pd.get_controlling_option (), + gmsgid, &ap); va_end (ap); } diff --git a/gcc/diagnostic-core.h b/gcc/diagnostic-core.h index 7918bd7d4a2..f5e1e500dc3 100644 --- a/gcc/diagnostic-core.h +++ b/gcc/diagnostic-core.h @@ -123,12 +123,12 @@ extern bool emit_diagnostic (diagnostic_t, rich_location *, int, const char *, ...) ATTRIBUTE_GCC_DIAG(4,5); extern bool emit_diagnostic_valist (diagnostic_t, location_t, int, const char *, va_list *) ATTRIBUTE_GCC_DIAG (4,0); -extern bool emit_diagnostic_valist (diagnostic_t, - rich_location *, - const diagnostic_metadata *, - int, - const char *, - va_list *) ATTRIBUTE_GCC_DIAG (5,0); +extern bool emit_diagnostic_valist_meta (diagnostic_t, + rich_location *, + const diagnostic_metadata *, + int, + const char *, + va_list *) ATTRIBUTE_GCC_DIAG (5,0); extern bool seen_error (void); #ifdef BUFSIZ diff --git a/gcc/diagnostic.cc b/gcc/diagnostic.cc index f5411b1ede0..1d143fa7498 100644 --- a/gcc/diagnostic.cc +++ b/gcc/diagnostic.cc @@ -1837,11 +1837,11 @@ emit_diagnostic_valist (diagnostic_t kind, location_t location, int opt, /* As above, but with rich_location and metadata. */ bool -emit_diagnostic_valist (diagnostic_t kind, - rich_location *richloc, - const diagnostic_metadata *metadata, - int opt, - const char *gmsgid, va_list *ap) +emit_diagnostic_valist_meta (diagnostic_t kind, + rich_location *richloc, + const diagnostic_metadata *metadata, + int opt, + const char *gmsgid, va_list *ap) { return diagnostic_impl (richloc, metadata, opt, gmsgid, ap, kind); }