From patchwork Fri Jan 27 15:45:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Wakely X-Patchwork-Id: 49463 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp901137wrn; Fri, 27 Jan 2023 07:46:32 -0800 (PST) X-Google-Smtp-Source: AMrXdXvh6Jfhe9lbehrpbIFxM0/N8Od9QnG9hgDXQGFrR/FN0ujjRDH0eYDTiaTnOheGZpjwJcYv X-Received: by 2002:aa7:c549:0:b0:46a:732e:fd29 with SMTP id s9-20020aa7c549000000b0046a732efd29mr51156864edr.42.1674834392386; Fri, 27 Jan 2023 07:46:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674834392; cv=none; d=google.com; s=arc-20160816; b=M+K7pR9aXq2+eE/6NwommdKh5pIPG6yoeeCKw2DRjJEpf4lR3f8/nXF+mjD5Q4KpU3 0f9lKHkk5dslffMpLdj0JuAJb3VXhuj+yTJ0EFwmG1WBbFwQg/h5Gh1t+foI2PZ7/pCI lWc/eheM2rirlwNIG7Xb1f4m5a/lb0Tjt1LEcg1lBPhz/yMxGl0H9kW32diCrvNl/jRK Oai86gLCePi0hWmEKmvedGf4DePHNrnXknqzI3qVF9ARLyChRMuNtIkGByI01xtTeuWe F97uiQB0yE0QNRdaS16s672qYuB3N77FGXoWvn8iBRLn/Oe3QWkk+VthDVz9fPTo5ils W46Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence :content-transfer-encoding:mime-version:message-id:date:subject:cc :to:dmarc-filter:delivered-to:dkim-signature:dkim-filter; bh=w7vI6tJsstLt+n2aqpmuRDal/iEzQwbnjjYFlpv41aA=; b=l0pn3xe4rpt1OcMIOev5Y564GYaAJpU4Ek88NfmPF69JVZXRi0WtlUy+T41j4KbHat MNIcpGb/psoj0tRFpW8mIQ8otCcS/CjIXz7HCMPDZSxf0qzCfaAEAyYwTrvK1RrRYhqU Iw93yMRKZoNpLNdmud8J/Y8O2dFxa/yX1wsFs/F5k27BT/QF2STcu8HmoUK3ouz7BHVS MOfZHmLmKTBvM+AE7jXcrhAaqzoxBRk9uoNlqWlRfLalL5KyG8vOjN8cdW66jl7ptPyM UMWutWKSIsgX68OVPiJLSTh3QrwoI9D4P5m0Ct/zbI7rHA0ZLGK/zJjgbESEYNDQBWLu /sTw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=BKtImuJ+; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from sourceware.org (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id v1-20020a50d581000000b0049d861dce55si5443753edi.30.2023.01.27.07.46.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Jan 2023 07:46:32 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=BKtImuJ+; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 77D4C385483E for ; Fri, 27 Jan 2023 15:46:18 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 77D4C385483E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1674834378; bh=w7vI6tJsstLt+n2aqpmuRDal/iEzQwbnjjYFlpv41aA=; h=To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=BKtImuJ+OVJG/2aJbUz0MsL+bAPOfz+FzFYvvzUAqyJwk8mLc5YlgAZrKCYgRt9ed aToETxtPnaPv4hJwo+I1BIDGctYs+8hY01Vh8JwqXp8zAu9Sxj9gX8bOGPq3WldCFH wCtUgEIZ/9Cmc98hsD3T/rlzpCx49d8MqZ68m0SU= 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 1B0833858002 for ; Fri, 27 Jan 2023 15:45:35 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 1B0833858002 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-510-uO81rJi0NCS3cmUPLKLVWA-1; Fri, 27 Jan 2023 10:45:32 -0500 X-MC-Unique: uO81rJi0NCS3cmUPLKLVWA-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 922F83814958; Fri, 27 Jan 2023 15:45:30 +0000 (UTC) Received: from localhost (unknown [10.33.36.186]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5057018EC1; Fri, 27 Jan 2023 15:45:30 +0000 (UTC) To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org Cc: Michael Welsh Duggan Subject: [committed] libstdc++: Use constant for name of tzdata file Date: Fri, 27 Jan 2023 15:45:29 +0000 Message-Id: <20230127154529.1601707-1-jwakely@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.5 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-12.2 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_H2, 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.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Jonathan Wakely via Gcc-patches From: Jonathan Wakely Reply-To: Jonathan Wakely Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1756191147778915995?= X-GMAIL-MSGID: =?utf-8?q?1756191147778915995?= Thanks to Michael Welsh Duggan for pointing this out. Tested x86_64-linux. Pushed to trunk. -- >8 -- There's a string_view with this filename, which should have been used instead of a string literal. libstdc++-v3/ChangeLog: * src/c++20/tzdb.cc (tzdata_stream): Use constant instead of string literal. --- libstdc++-v3/src/c++20/tzdb.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libstdc++-v3/src/c++20/tzdb.cc b/libstdc++-v3/src/c++20/tzdb.cc index c956e861891..2e7e173f0ef 100644 --- a/libstdc++-v3/src/c++20/tzdb.cc +++ b/libstdc++-v3/src/c++20/tzdb.cc @@ -1106,7 +1106,7 @@ namespace std::chrono tzdata_stream() : istream(nullptr) { - if (string path = zoneinfo_file("/tzdata.zi"); !path.empty()) + if (string path = zoneinfo_file(tzdata_file); !path.empty()) { filebuf fbuf; if (fbuf.open(path, std::ios::in))