From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 529F93858D39; Wed, 10 Apr 2024 01:10:24 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 529F93858D39 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1712711424; bh=gueyt3G/vkhtrcdcLFSj0Rw6N5Nq92deF6oaIzZGegc=; h=From:To:Subject:Date:In-Reply-To:References:From; b=ntgRA9MePvGBJaEeBpyocC6SjjYvxcJKXncbXSmruVB7ff2ma8HyEG8fJBJ0sZ8Lm Cy/s2Zb8J7cq3/0Nm18rN7dhv5ABksg0izCGqgw2DPFUrXC+WED+e7h6dSbTQeGxOV M3kxiE175LbIGvUgWxa81hkE/MV5IgmTSDpWMuVM= From: "redi at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/114645] std::chrono::current_zone ignores $TZ on Linux Date: Wed, 10 Apr 2024 01:10:23 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libstdc++ X-Bugzilla-Version: 13.2.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: redi at gcc dot gnu.org X-Bugzilla-Status: RESOLVED X-Bugzilla-Resolution: WONTFIX X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D114645 --- Comment #23 from Jonathan Wakely --- Re https://github.com/cplusplus/draft/issues/6922 It can't possibly mean that the returned time zone *needs* to be the same as the C library, because that's impossible in general, because the C library isn't required to use IANA zones at all. See my TZ=3Dgarbage23nonsense exam= ple. There is no way to match that with std::chrono::time_zone without pointer lifetime issues and inconsistencies like returning a time_zone that isn't in the tzdb. And if the C++ standard intended to require that TZ is respected on POSIX systems, then it would say so. The absence of any requirement means it's not required. TZ is not mentioned in the standard at all. The standard probably isn't going to say it *must not* be used, because it's not in the business = of listing (or forbidding) possible vendor extensions. There might be systems where a TZ environment var is the only way the time zone can be set, and it always is an IANA zone. But I don't believe any of the targets libstdc++ supports fit into that category.=