practicalswift
commented at 9:58 am on November 23, 2020:
contributor
Make Parse{Int,UInt}{32,64} use locale independent std::from_chars(…) (C++17) instead of locale dependent strto{l,ll,ul,ull}.
About std::from_chars: “Unlike other parsing functions in C++ and C libraries, std::from_chars is locale-independent, non-allocating, and non-throwing.”
fanquake added the label
Utils/log/libs
on Nov 23, 2020
laanwj
commented at 10:07 am on November 23, 2020:
member
DrahtBot
commented at 10:53 am on November 23, 2020:
member
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
Conflicts
Reviewers, this pull request conflicts with the following ones:
#20452 (util: Replace use of locale dependent atoi(…) with locale-independent std::from_chars(…) (C++17) by practicalswift)
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.
practicalswift force-pushed
on Nov 23, 2020
practicalswift force-pushed
on Nov 23, 2020
practicalswift force-pushed
on Nov 23, 2020
MarcoFalke referenced this in commit
9402159b9b
on Nov 24, 2020
practicalswift force-pushed
on Nov 24, 2020
sidhujag referenced this in commit
3a1441004a
on Nov 24, 2020
DrahtBot added the label
Needs rebase
on Nov 30, 2020
practicalswift force-pushed
on Dec 1, 2020
DrahtBot removed the label
Needs rebase
on Dec 1, 2020
practicalswift
commented at 3:57 pm on December 1, 2020:
contributor
Like #20452 this one is blocked on #20460. That’s the reason for the CI failures :)
MarcoFalke added the label
Waiting for author
on Dec 1, 2020
practicalswift
commented at 12:57 pm on December 15, 2020:
contributor
Could remove “Waiting for author”? I don’t know if we have any “Blocked on another PR/issue” (or “Waiting for toolchain upgrade”) tag, but this PR is blocked on #20460 :)
MarcoFalke added the label
Waiting for other
on Dec 15, 2020
MarcoFalke removed the label
Waiting for author
on Dec 15, 2020
DrahtBot added the label
Needs rebase
on Dec 15, 2020
practicalswift force-pushed
on Dec 16, 2020
DrahtBot removed the label
Needs rebase
on Dec 16, 2020
practicalswift force-pushed
on Mar 2, 2021
jonatack
commented at 9:43 pm on March 2, 2021:
member
Concept ACK. Looks very good; hope to see this unblocked with std::fs.
DrahtBot added the label
Needs rebase
on Mar 19, 2021
practicalswift force-pushed
on Mar 19, 2021
DrahtBot removed the label
Needs rebase
on Mar 19, 2021
practicalswift force-pushed
on Apr 24, 2021
MarcoFalke added this to the milestone 23.0
on Apr 24, 2021
practicalswift force-pushed
on May 12, 2021
practicalswift force-pushed
on Jun 13, 2021
practicalswift force-pushed
on Jun 22, 2021
practicalswift force-pushed
on Jun 22, 2021
practicalswift force-pushed
on Jun 22, 2021
PastaPastaPasta referenced this in commit
46a05ad537
on Jun 27, 2021
PastaPastaPasta referenced this in commit
f059da98e6
on Jun 28, 2021
PastaPastaPasta referenced this in commit
840d3332e4
on Jun 29, 2021
practicalswift force-pushed
on Jun 30, 2021
PastaPastaPasta referenced this in commit
1c80f26441
on Jul 1, 2021
PastaPastaPasta referenced this in commit
dea0bfecd1
on Jul 1, 2021
PastaPastaPasta referenced this in commit
1621639e85
on Jul 15, 2021
practicalswift force-pushed
on Aug 15, 2021
practicalswift force-pushed
on Sep 5, 2021
PastaPastaPasta referenced this in commit
0bb4bb8db0
on Sep 17, 2021
util: Introduce ToIntegral<T>(const std::string&) for locale independent parsing using std::from_chars(…) (C++17)
util: Avoid locale dependent functions strtol/strtoll/strtoul/strtoull in ParseInt32/ParseInt64/ParseUInt32/ParseUInt64
fuzz: Assert equivalence between new and old Parse{Int,Uint}{8,32,64} functions
test: Add unit tests for ToIntegral<T>(const std::string&)
4747db8761
practicalswift force-pushed
on Sep 18, 2021
PastaPastaPasta referenced this in commit
4485b3ea20
on Sep 19, 2021
PastaPastaPasta referenced this in commit
40f2d3e692
on Sep 21, 2021
PastaPastaPasta referenced this in commit
2328ead832
on Sep 24, 2021
fanquake referenced this in commit
67eae69f3f
on Sep 28, 2021
MarcoFalke removed the label
Waiting for other
on Sep 28, 2021
practicalswift
commented at 2:18 pm on September 29, 2021:
contributor
Now that #20460 has been merged I think this PR should be ready for final review :)
MarcoFalke
commented at 10:02 am on October 1, 2021:
Can you explain what the { are supposed to do? I think they can be removed, as they are confusing as-is. If you want them to check (for whatever reason) that result fits in type T, you will have to type return T{result};
In this specific case return result; should be equivalent to return {result}; since the return type is std::optional<T> and result is of type T. I can see your point about braces looking a bit odd here: feel free to change :)
Some context behind the “braced return” style more generally: it can help avoid nasty implicit narrowing conversions like in the following example.
MarcoFalke
commented at 10:19 am on October 1, 2021:
member
crACK
in
src/util/strencodings.h:106
in
4747db8761
101+ *
102+ * @returns std::nullopt if the entire string could not be parsed, or if the
103+ * parsed value is not in the range representable by the type T.
104+ */
105+template <typename T>
106+std::optional<T> ToIntegral(const std::string& str)
MarcoFalke
commented at 4:01 pm on October 1, 2021:
I am wondering if it makes sense to explain in simple terms the format that is required to be parsed successfully. In regex terms it would be -?[0-9]+?
MarcoFalke
commented at 4:10 pm on October 1, 2021:
member
MarcoFalke referenced this in commit
42fedb4acd
on Oct 4, 2021
sidhujag referenced this in commit
9f1da3bdbe
on Oct 4, 2021
kittywhiskers referenced this in commit
91f5c0d329
on Oct 12, 2021
rebroad
commented at 4:17 pm on October 13, 2021:
contributor
0 CXX qt/qt_bitcoin_qt-main.o
1In file included from qt/main.cpp:5: 2In file included from ./qt/bitcoin.h:12: 3In file included from ./interfaces/node.h:10: 4In file included from ./net.h:9: 5In file included from ./addrman.h:9: 6In file included from ./netaddress.h:19: 7./util/strencodings.h:16:10: fatal error: 'charconv' file not found
8#include<charconv> 9^~~~~~~~~~101 error generated.
11Makefile:12673: recipe for target 'qt/qt_bitcoin_qt-main.o' failed
12make: *** [qt/qt_bitcoin_qt-main.o] Error 1
sipa
commented at 4:19 pm on October 13, 2021:
member
@rebroad Bizarre, sounds like you’re not using a C++17 compliant compiler.
rebroad
commented at 4:35 pm on October 13, 2021:
contributor
@rebroad Bizarre, sounds like you’re not using a C++17 compliant compiler.
Still getting the same error when compiling in a clean directory… could it be an issue caused by ccache?
rebroad
commented at 6:53 pm on October 13, 2021:
contributor
04747db876154ddd828c03d9eda10ecf8b25d8dc8 is the first bad commit
1commit 4747db876154ddd828c03d9eda10ecf8b25d8dc8
2Author: practicalswift <practicalswift@users.noreply.github.com> 3Date: Sat Sep 1804:30:302021+0000 4 5 util: Introduce ToIntegral<T>(const std::string&) for locale independent parsing using std::from_chars(…) (C++17)
6 7 util: Avoid locale dependent functions strtol/strtoll/strtoul/strtoull in ParseInt32/ParseInt64/ParseUInt32/ParseUInt64
8 9 fuzz: Assert equivalence between new and old Parse{Int,Uint}{8,32,64} functions
1011 test: Add unit tests for ToIntegral<T>(const std::string&)
1213:040000040000ec09e7aa0a2bec6f5021c2bf2994a0fc67e65c1f aa5170295604fa240939c86c02f26a6e436be964 M src
14:040000040000aa260b3d4bb2c554e68a7b0baa241a2cfc97818a c5d3df2e7337c8cc6a5a2141844b5c1b81a6ba51 M test
kittywhiskers referenced this in commit
b306f19560
on Oct 21, 2022
kittywhiskers referenced this in commit
e329b303aa
on Oct 21, 2022
kittywhiskers referenced this in commit
3e658233e4
on Oct 27, 2022
kittywhiskers referenced this in commit
3a3eb6e66a
on Oct 27, 2022
kittywhiskers referenced this in commit
609344ee82
on Oct 30, 2022
kittywhiskers referenced this in commit
eaa517a3e9
on Oct 30, 2022
This is a metadata mirror of the GitHub repository
bitcoin/bitcoin.
This site is not affiliated with GitHub.
Content is generated from a GitHub metadata backup.
generated: 2024-11-17 03:12 UTC
This site is hosted by @0xB10C More mirrored repositories can be found on mirror.b10c.me