From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 6DA573858D35; Sat, 15 Jul 2023 14:52:21 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6DA573858D35 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1689432741; bh=eC7I14+rLUdRJOj8Cc31z/VM0ZO90Qy91D7YcSnXh/E=; h=From:To:Subject:Date:In-Reply-To:References:From; b=jmzrZYkF6CH653SwxtNwIVFcIplV7E3EI2biCB+uVn6UceiddFBAtAmEQnM2yh9E+ V+Wt2t8ptPGqX8xqnJnsOmQrpt1zHnJHv9OWiqMeRhQg2GYyBrVvTraydg87ZtuJjp yk3MgxeDSUv5M4nG/povqppEUuIjiQzzGlT+wXTs= From: "dave.anglin at bell dot net" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/110653] Support std::stoi etc. without C99 APIs Date: Sat, 15 Jul 2023 14:52:20 +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: dave.anglin at bell dot net 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 #11 from dave.anglin at bell dot net --- On 2023-07-14 5:58 a.m., redi at gcc dot gnu.org wrote: > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D110653 > > --- Comment #10 from Jonathan Wakely --- > And this should fix it: > > --- a/libstdc++-v3/include/c_global/cstdlib > +++ b/libstdc++-v3/include/c_global/cstdlib > @@ -256,6 +256,20 @@ namespace std > using ::__gnu_cxx::strtold; > } // namespace std > > +#else // ! _GLIBCXX_USE_C99_STDLIB > + > +// We also check for strtof and strtold separately from > _GLIBCXX_USE_C99_STDLIB > + > +#if _GLIBCXX_HAVE_STRTOF > +#undef strtof > +namespace std { using ::strtof; } > +#endif > + > +#if _GLIBCXX_HAVE_STRTOLD > +#undef strtold > +namespace std { using ::strtold; } > +#endif > + > #endif // _GLIBCXX_USE_C99_STDLIB > > } // extern "C++" Yes, this works. hppa64-hpux does not have have strtof.=C2=A0 Could std::stof be implemented= using strtod in this case? I'm thinking a test to check the presence and maybe compliance of these routines might be good.=