From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 58A1C3858C33; Thu, 13 Jul 2023 16:59:33 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 58A1C3858C33 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1689267573; bh=RmCpTXRu5vkxOAY2+z6oU9m6w87CrhIY0ILiBcWAIzI=; h=From:To:Subject:Date:In-Reply-To:References:From; b=VXDEqwMbEnoZ2XZ7rO5867gAIwuvOWx7lmEBpMAyXJWSycSu1xVZh3h7FEeKOxk2R fLILjwLc1/tCHSjI50Xeoom5fal5d8uh/SGK93gj3JphPU80snQLXkV0/Qwos8a8qr 01Qu7kLkTYsMN8Y89sbsZ098umirXByf2YmiFgnI= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/110653] Support std::stoi etc. without C99 APIs Date: Thu, 13 Jul 2023 16:59:33 +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: 14.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: redi 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=3D110653 --- Comment #4 from CVS Commits --- The master branch has been updated by Jonathan Wakely : https://gcc.gnu.org/g:a1d12752f8d45df5d7962cef6e2a87585002e982 commit r14-2504-ga1d12752f8d45df5d7962cef6e2a87585002e982 Author: Jonathan Wakely Date: Thu Jul 13 10:44:57 2023 +0100 libstdc++: std::stoi etc. do not need C99 support [PR110653] std::stoi, std::stol, std::stoul, and std::stod only depend on C89 functions, so don't need to be guarded by _GLIBCXX_USE_C99_STDLIB std::stoll and std::stoull don't need C99 strtoll and strtoull if sizeof(long) =3D=3D sizeof(long long). std::stold doesn't need C99 strtold if DBL_MANT_DIG =3D=3D LDBL_MANT_DI= G. This only applies to the narrow character overloads, the wchar_t overloads depend on a separate _GLIBCXX_USE_C99_WCHAR macro and none of them can be implemented in C89 easily. libstdc++-v3/ChangeLog: PR libstdc++/110653 * include/bits/basic_string.h (stoi, stol, stoul, stod): Do not depend on _GLIBCXX_USE_C99_STDLIB. [__LONG_WIDTH__ =3D=3D __LONG_LONG_WIDTH__] (stoll, stoull): De= fine in terms of stol and stoul respectively. [__DBL_MANT_DIG__ =3D=3D __LDBL_MANT_DIG__] (stold): Define in = terms of stod.=