From patchwork Thu Jan 20 09:43:55 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Martin_Li=C5=A1ka?= X-Patchwork-Id: 50264 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id B78823857817 for ; Thu, 20 Jan 2022 09:44:50 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by sourceware.org (Postfix) with ESMTPS id 0FF063857809 for ; Thu, 20 Jan 2022 09:43:57 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 0FF063857809 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.cz Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id DD0B21F394 for ; Thu, 20 Jan 2022 09:43:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1642671835; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3Yoh9ml5JPzKmJQqqsMttG5KMjzmjZc4u9BJsTISAv8=; b=WKW3YPhXvFfuGxWyVPb4Ur9WKf6A1IZS4nqEg041DcTepDe7xbw4dbjcwWbyXnJUJ0ibCl Slkxa3QBO3QOex/eMNypH4hLuxPlU0PyGgQQoNpwmZ67oAaRgI8NTgbJa+35QO8fQ5yATU D2aS3HzKoHWo+qamSuRI+4ZJdIDOgrg= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1642671835; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3Yoh9ml5JPzKmJQqqsMttG5KMjzmjZc4u9BJsTISAv8=; b=UatqfoMy173+cNNThLXW/ybYZuqF4d/NQi2Pmz6YIsR/rteKKoaqr6URF9n2e78YllG5jD vjD+rnYk46gElnCA== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id CDAD113D27 for ; Thu, 20 Jan 2022 09:43:55 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id WcI6Mdsu6WEOEQAAMHmgww (envelope-from ) for ; Thu, 20 Jan 2022 09:43:55 +0000 Message-ID: <9532d734-eac1-eecb-6dbe-cd0a7fc55b36@suse.cz> Date: Thu, 20 Jan 2022 10:43:55 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 From: =?utf-8?q?Martin_Li=C5=A1ka?= Subject: [PATCH] Fix Werror=format-diag with --disable-nls. To: gcc-patches@gcc.gnu.org Content-Language: en-US X-Spam-Status: No, score=-11.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" The patch disables "-Wformat-diag" for dump_aggr_type. Patch can bootstrap on x86_64-linux-gnu and survives regression tests. Ready to be installed? Thanks, Martin PR c++/104134 gcc/cp/ChangeLog: * error.cc (dump_aggr_type): Partially disable the warning. --- gcc/cp/error.cc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/gcc/cp/error.cc b/gcc/cp/error.cc index 1ab0c25a477..c031c75cc5e 100644 --- a/gcc/cp/error.cc +++ b/gcc/cp/error.cc @@ -768,6 +768,11 @@ class_key_or_enum_as_string (tree t) return "struct"; } +#if __GNUC__ >= 10 +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wformat-diag" +#endif + /* Print out a class declaration T under the control of FLAGS, in the form `class foo'. */ @@ -851,6 +856,10 @@ dump_aggr_type (cxx_pretty_printer *pp, tree t, int flags) flags & ~TFF_TEMPLATE_HEADER); } +#if __GNUC__ >= 10 +#pragma GCC diagnostic pop +#endif + /* Dump into the obstack the initial part of the output for a given type. This is necessary when dealing with things like functions returning functions. Examples: