From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 70EF23858401 for ; Fri, 30 Jun 2023 14:30:20 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 70EF23858401 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1688135419; 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=2DviRN6RoK98Tgybhu6Y9H+yrub2SH+P7UP/1SseM4k=; b=QGB+ovHjSPQfRgkXbl/ry+U3Ktxp8O9+tOqrgOBJuYzsoEq2SNrYxjYfkDGAal3Mf98Zn1 z6FjVsyyIk6v2GLUVIBh3W/xEL9Ihezuxjcm+MDB0B1LO5tx11P38oTT4QzeLNmf4cad9A e+X38HqAp3JF+EgReuAV7Xv7wpgnpTY= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-219-RLhWubqXNbSoNMSPzJqnrQ-1; Fri, 30 Jun 2023 10:30:18 -0400 X-MC-Unique: RLhWubqXNbSoNMSPzJqnrQ-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id F18483C28BEA; Fri, 30 Jun 2023 14:30:17 +0000 (UTC) Received: from localhost (unknown [10.42.28.54]) by smtp.corp.redhat.com (Postfix) with ESMTP id B4FEE492C13; Fri, 30 Jun 2023 14:30:17 +0000 (UTC) From: Jonathan Wakely To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: [committed] libstdc++: Fix unused warning for new variable Date: Fri, 30 Jun 2023 15:29:57 +0100 Message-ID: <20230630143017.728971-1-jwakely@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain Content-Transfer-Encoding: 8bit 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,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 List-Id: Tested powerpc64le-linux and x86_64-linux. Pushed to trunk. -- >8 -- This newly-introduced variable isn't used on all paths, so add the [[maybe_unused]] attribute. libstdc++-v3/ChangeLog: * src/c++11/random.cc (random_device::_M_init): Add maybe_unused attribute. --- libstdc++-v3/src/c++11/random.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libstdc++-v3/src/c++11/random.cc b/libstdc++-v3/src/c++11/random.cc index cece6edbfc7..75989bd3337 100644 --- a/libstdc++-v3/src/c++11/random.cc +++ b/libstdc++-v3/src/c++11/random.cc @@ -374,11 +374,11 @@ namespace std _GLIBCXX_VISIBILITY(default) " unsupported token")); #if defined ENOSYS - const int unsupported = ENOSYS; + [[maybe_unused]] const int unsupported = ENOSYS; #elif defined ENOTSUP - const int unsupported = ENOTSUP; + [[maybe_unused]] const int unsupported = ENOTSUP; #else - const int unsupported = 0; + [[maybe_unused]] const int unsupported = 0; #endif int err = 0; -- 2.41.0