-
Notifications
You must be signed in to change notification settings - Fork 37.8k
test: Remove last uses of snprintf and simplify #27036
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ReviewsSee the guideline for information on the review process.
If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update. |
One test case uses snprintf to convert an int to a string. Change it to use ToString (which uses a locale-independent version of std::to_string). Also remove unnecessary parts of StringContentsSerializer.
c91783b
to
b803229
Compare
Concept ACK. Maybe verify if the linter files need updating (test/lint/lint-locale-dependence.py?) |
Thanks! Pushed that change about a half hour ago. You were too quick 😄 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Concept ACK
b803229 Remove use of snprintf and simplify (John Moffett) Pull request description: These are the only remaining uses of `snprintf` in our project, and they can cause unexpected issues -- for example, see bitcoin#27014. Change them to use our `ToString` (which uses a locale-independent version of `std::to_string`) to convert an `int` to `std::string`. Also remove resulting unused parts of `StringContentsSerializer`. Closes bitcoin#27014 ACKs for top commit: Sjors: tACK b803229, fixes bitcoin#27014. Tree-SHA512: c903977e654711929decafe8887d0de13b38a340d7082875acc5d41950d834dcfde074e9cabecaf5f9a760f62c34322297b4b156af29761650ef5803b1a54b59
30a3230 script: remove out-of-date snprintf TODO (Jon Atack) 0e01514 net: remove orphaned CSubNet::SanityCheck() (Jon Atack) Pull request description: `CSubNet::SanityCheck()` was added in #20140, and not removed in #22570 when it became orphaned code. Also, remove an out-of-date `snprintf` TODO that was resolved in #27036, and fix up 2 words to make the spelling linter green again. ACKs for top commit: fanquake: ACK 30a3230 pinheadmz: ACK 30a3230 brunoerg: crACK 30a3230 Tree-SHA512: f91a2a5af902d3b82ab496f19deeac17d58dbf72a8016e880ea61ad858b66e7ea0ae70b964c4032018eb3252cc34ac5fea163131c6a7f1baf87fc9ec9b5833d8
30a3230 script: remove out-of-date snprintf TODO (Jon Atack) 0e01514 net: remove orphaned CSubNet::SanityCheck() (Jon Atack) Pull request description: `CSubNet::SanityCheck()` was added in bitcoin#20140, and not removed in bitcoin#22570 when it became orphaned code. Also, remove an out-of-date `snprintf` TODO that was resolved in bitcoin#27036, and fix up 2 words to make the spelling linter green again. ACKs for top commit: fanquake: ACK 30a3230 pinheadmz: ACK 30a3230 brunoerg: crACK 30a3230 Tree-SHA512: f91a2a5af902d3b82ab496f19deeac17d58dbf72a8016e880ea61ad858b66e7ea0ae70b964c4032018eb3252cc34ac5fea163131c6a7f1baf87fc9ec9b5833d8
These are the only remaining uses of
snprintf
in our project, and they can cause unexpected issues -- for example, see #27014. Change them to use ourToString
(which uses a locale-independent version ofstd::to_string
) to convert anint
tostd::string
. Also remove resulting unused parts ofStringContentsSerializer
.Closes #27014