This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/56336] Buggy implementation of stoi, stol, stoll
- From: "paolo.carlini at oracle dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 15 Feb 2013 10:24:19 +0000
- Subject: [Bug libstdc++/56336] Buggy implementation of stoi, stol, stoll
- Auto-submitted: auto-generated
- References: <bug-56336-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56336
Paolo Carlini <paolo.carlini at oracle dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |INVALID
--- Comment #2 from Paolo Carlini <paolo.carlini at oracle dot com> 2013-02-15 10:24:19 UTC ---
I disagree that we have a bug here. The Standard says that invalid_argument is
thrown if strtol, etc report that no conversion could be performed. Here a
conversion can be performed, for the first 4 chars. Note that in general in
this context - the strto* functions which are being wrapped - it's normal that
only the first part of the passed string represents a valid number, there is
nothing strange about this, and *idx, the second argument to the sto*
functions, which you are not using, is correctly updated to point to 'x', as
the Standard requests.