From patchwork Tue Apr 6 17:45:43 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Iain Buclaw X-Patchwork-Id: 1462939 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=sourceware.org; envelope-from=gcc-patches-bounces@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha256 header.s=default header.b=CU1tfim6; dkim-atps=neutral Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4FFFLd5WdVz9sTD for ; Wed, 7 Apr 2021 03:46:01 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id D261E3857823; Tue, 6 Apr 2021 17:45:59 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D261E3857823 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1617731159; bh=aAfp5oJ8sdCuPc8FlS0aZnPKsVJzZfzg1e44WsVNvd4=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=CU1tfim62376kDHjomOl+sQ6pl1FOEFWFwfV8mJySh0BvAjo47DcKIJmyirijcxoa o3Sa0C6+qg1JShp6nB4A6dEylWeUvtf55BfQCHRGHi9kcvdxCwtKXemi+2G2gWmO43 gSBqO0+AxoHUuDjcn05eTC8gOoVFHBJUK/h98PXM= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mout-p-102.mailbox.org (mout-p-102.mailbox.org [IPv6:2001:67c:2050::465:102]) by sourceware.org (Postfix) with ESMTPS id C10B53857805 for ; Tue, 6 Apr 2021 17:45:56 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org C10B53857805 Received: from smtp2.mailbox.org (smtp2.mailbox.org [80.241.60.241]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-102.mailbox.org (Postfix) with ESMTPS id 4FFFLW35C6zQjmM; Tue, 6 Apr 2021 19:45:55 +0200 (CEST) X-Virus-Scanned: amavisd-new at heinlein-support.de Received: from smtp2.mailbox.org ([80.241.60.241]) by spamfilter01.heinlein-hosting.de (spamfilter01.heinlein-hosting.de [80.241.56.115]) (amavisd-new, port 10030) with ESMTP id 3-w5z4DVSwdg; Tue, 6 Apr 2021 19:45:44 +0200 (CEST) To: gcc-patches@gcc.gnu.org Subject: [committed] d: Increment gaggedWarnings if warning or deprecation message was suppressed Date: Tue, 6 Apr 2021 19:45:43 +0200 Message-Id: <20210406174543.1594001-1-ibuclaw@gdcproject.org> MIME-Version: 1.0 X-MBO-SPAM-Probability: ****** X-Rspamd-Score: 8.33 / 15.00 / 15.00 X-Rspamd-Queue-Id: 28C711810 X-Rspamd-UID: 30b76a X-Spam-Status: No, score=-16.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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: , X-Patchwork-Original-From: Iain Buclaw via Gcc-patches From: Iain Buclaw Reply-To: Iain Buclaw Errors-To: gcc-patches-bounces@gcc.gnu.org Sender: "Gcc-patches" Hi, This patch increments gaggedWarnings count if a warning or deprecation message was suppressed. Used by the front-end to catch potential errors in code that is being compiled in a speculative context. Bootstrapped and regression tested on x86_64-linux-gnu/-m32/-mx32 and committed to mainline. Regards, Iain. --- gcc/d/ChangeLog: * d-diagnostic.cc (vwarning): Increment gaggedWarnings if warning message was suppressed. (vdeprecation): Likewise for deprecation messages. --- gcc/d/d-diagnostic.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gcc/d/d-diagnostic.cc b/gcc/d/d-diagnostic.cc index 659fae24459..3bf5a535edd 100644 --- a/gcc/d/d-diagnostic.cc +++ b/gcc/d/d-diagnostic.cc @@ -239,6 +239,8 @@ vwarning (const Loc &loc, const char *format, va_list ap) d_diagnostic_report_diagnostic (loc, 0, format, ap, DK_WARNING, false); } + else if (global.gag) + global.gaggedWarnings++; } /* Print supplementary message about the last warning with explicit location @@ -297,6 +299,8 @@ vdeprecation (const Loc &loc, const char *format, va_list ap, DK_WARNING, false); free (xformat); } + else if (global.gag) + global.gaggedWarnings++; } /* Print supplementary message about the last deprecation with explicit