From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 39E5B3858D37; Mon, 13 Jul 2020 11:15:56 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 39E5B3858D37 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1594638956; bh=/BSsQRa+XpUR5QIXQ9WebiMvyzPsr7tRCEHkQZTnGFw=; h=From:To:Subject:Date:In-Reply-To:References:From; b=kPr59yktgOTEuBh3duRgSp+dzT++VYDDXtFEKc4m34PRm4vLOjnrKPq1KjiubmVTE fs+C0CyVzgzODAMrOzp5CVt2G/rYw8sIO7jA+3BcZ8e7418rteU556hPuGM3fagXHu ZbLwOAGmX1LNkXiFtRXpJvEtqe6dboPbUJ1WNUJE= From: "redi at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/70493] std::setlocale("") throws exception Date: Mon, 13 Jul 2020 11:15:56 +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: unknown 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: bug_status resolution 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 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Jul 2020 11:15:56 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D70493 Jonathan Wakely changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution|--- |WONTFIX --- Comment #2 from Jonathan Wakely --- Libstdc++ has no idea why the locale name was invalid. When you use the emp= ty string "" it constructs a locale name from the environment and then calls newlocale from the C library. newlocale returns (locale_t)0 and sets ENOENT, which according to POSIX means "For any of the categories in category_mask,= the locale data is not available" (or for the GNU C library, "locale is not a string pointer referring to a valid locale"). Unless libstdc++ is going to iteratively try creating a locale from each of= the LC_* environment variables to see which one failed, it can't really give you any better information. That doesn't seem worth the effort (and increase in code size), sorry.=