From faf55fc80b11f3d9b0b12c1b26a9612ea9ce9b40 Mon Sep 17 00:00:00 2001 From: MarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz> Date: Mon, 19 May 2025 23:58:33 +0200 Subject: [PATCH] doc: Remove ParseInt mentions in documentation In the dev notes, remove the whole section, because: * ParseDouble was removed in commit fa9d72a7947d2cff541794e21e0040c3c1d43b32 * The locale-dependent atoi is already checked by test/lint/lint-locale-dependence.py Co-authored-by: Fabian Jahr --- doc/developer-notes.md | 4 ---- src/util/strencodings.h | 3 +-- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/doc/developer-notes.md b/doc/developer-notes.md index f9ad26651a8..4759146a8fc 100644 --- a/doc/developer-notes.md +++ b/doc/developer-notes.md @@ -1009,10 +1009,6 @@ Strings and formatting buffer overflows, and surprises with `\0` characters. Also, some C string manipulations tend to act differently depending on platform, or even the user locale. -- Use `ToIntegral` from [`strencodings.h`](/src/util/strencodings.h) for number parsing. In legacy code you might also find `ParseInt*` family of functions, `ParseDouble` or `LocaleIndependentAtoi`. - - - *Rationale*: These functions do overflow checking and avoid pesky locale issues. - - For `strprintf`, `LogInfo`, `LogDebug`, etc formatting characters don't need size specifiers. - *Rationale*: Bitcoin Core uses tinyformat, which is type safe. Leave them out to avoid confusion. diff --git a/src/util/strencodings.h b/src/util/strencodings.h index 154a610dfb4..01063858047 100644 --- a/src/util/strencodings.h +++ b/src/util/strencodings.h @@ -105,8 +105,7 @@ bool SplitHostPort(std::string_view in, uint16_t& portOut, std::string& hostOut) // LocaleIndependentAtoi is provided for backwards compatibility reasons. // -// New code should use ToIntegral or the ParseInt* functions -// which provide parse error feedback. +// New code should use ToIntegral. // // The goal of LocaleIndependentAtoi is to replicate the defined behaviour of // std::atoi as it behaves under the "C" locale, and remove some undefined