From patchwork Tue Jul 23 09:46:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Wakely X-Patchwork-Id: 1963708 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=EVV0O41s; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4WSskl1zYdz1yYm for ; Tue, 23 Jul 2024 19:47:27 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 84D193861834 for ; Tue, 23 Jul 2024 09:47:25 +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 ESMTP id AB3F6386101C for ; Tue, 23 Jul 2024 09:47:00 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org AB3F6386101C 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 AB3F6386101C 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=1721728024; cv=none; b=jkl9jLJ4u/0+S4wsM1NtNTaWtJrRu65HVOrYO4PKTLPrRQV2svpYVKvv64jQmxuY8vvKHnAWIYnkYS52ZmZgFTMn/8GQcz4NxjuL5h/MBntXaNaPVvmMFKjn4IiAkKzvnizq7u7huG+4p7iSqGQrxswroxYMdDadRKaEa0YovZY= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1721728024; c=relaxed/simple; bh=RVnWD49Ua04EPYOkjnjKshX95Roiao/pp2eW7vUzR1E=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=IWtsy51gXqG1HNGikwfTc9IrxiFjhNzIlXI7ocBLZ4X+XrnY3tiL8aco5ipGXYJno4KQ28JQ88DDs9oOEmt1WB/bxwqT9V1VugD0FqsrZQgfDvbK5VIeYMr5Qs2x+4Ua3IMum9HlMWt93bMe778RR7saQOzdjQ5w0BjIf5k2t0w= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1721728020; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fBO7qxVD1hyPlIgaM9G/aNiXpHNBXxCAagfU8jedPmU=; b=EVV0O41sMYg4IYTSLBR25BHD7njEjUyTQ5+WuLLKuum6HexiZsXufIyS+jFnKedtcdA7KW xrHqRofcPwNGlJrDs1kzZlDViXYdgJVrBm8rB7xB+c4nTymisced1CZW6JtDuw637vZRR8 gvl4a2RgKTo9g1t/tE0SkHsZlH1kQ/s= Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-168-FMte7RFBM3G33dwC2ZUehQ-1; Tue, 23 Jul 2024 05:46:58 -0400 X-MC-Unique: FMte7RFBM3G33dwC2ZUehQ-1 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (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 mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 72BD61955D4E; Tue, 23 Jul 2024 09:46:57 +0000 (UTC) Received: from localhost (unknown [10.42.28.14]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id AE6A11955F40; Tue, 23 Jul 2024 09:46:55 +0000 (UTC) From: Jonathan Wakely To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: [committed] libstdc++: Use [[maybe_unused]] attribute in src/c++23/print.cc Date: Tue, 23 Jul 2024 10:46:33 +0100 Message-ID: <20240723094653.3665220-1-jwakely@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-12.1 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 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~incoming=patchwork.ozlabs.org@gcc.gnu.org Tested x86_64-linux, built on avr. Pushed to trunk. -- >8 -- This avoids some warnings when the preprocessor conditions are not met. libstdc++-v3/ChangeLog: * src/c++23/print.cc (__open_terminal): Use [[maybe_unused]] on parameter. --- libstdc++-v3/src/c++23/print.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libstdc++-v3/src/c++23/print.cc b/libstdc++-v3/src/c++23/print.cc index 558dc149d12..8ba71405967 100644 --- a/libstdc++-v3/src/c++23/print.cc +++ b/libstdc++-v3/src/c++23/print.cc @@ -67,7 +67,7 @@ namespace // This returns intptr_t that is either a Windows HANDLE // or 1 + a POSIX file descriptor. A zero return indicates failure. void* - __open_terminal(FILE* f) + __open_terminal([[maybe_unused]] FILE* f) { #ifndef _GLIBCXX_USE_STDIO_PURE if (f) @@ -85,7 +85,7 @@ namespace } void* - __open_terminal(std::streambuf* sb) + __open_terminal([[maybe_unused]] std::streambuf* sb) { #if ! defined _GLIBCXX_USE_STDIO_PURE && defined __cpp_rtti using namespace __gnu_cxx;