diff options
author | fanquake <fanquake@gmail.com> | 2023-03-11 10:57:56 +0100 |
---|---|---|
committer | fanquake <fanquake@gmail.com> | 2023-03-11 11:02:03 +0100 |
commit | 3d53a85ddfb5dc74514d94cefa4ff4987646c576 (patch) | |
tree | a38f61b5f8407cf200087b6d0d7dda23a78c7e48 /doc | |
parent | c7f1d95f52883d7087b74f45f5e4ce1100d51149 (diff) | |
parent | da347de530242ead8f6a9718ee1440385bd3d44d (diff) | |
download | bitcoin-3d53a85ddfb5dc74514d94cefa4ff4987646c576.tar.xz |
Merge bitcoin/bitcoin#27220: doc: update broken str util reference links on developer-notes
da347de530242ead8f6a9718ee1440385bd3d44d doc: update broken links (pablomartin4btc)
Pull request description:
References to `utilstrencodings` and `lint-locale-dependence.sh` where incorrect, updating them accordingly.
Also, adding another reference to util function [`LocaleIndependentAtoi`](https://github.com/bitcoin/bitcoin/blob/master/src/util/strencodings.h#L108-L118), which is related with the updated section of the guide:
```
// LocaleIndependentAtoi is provided for backwards compatibility reasons.
//
// New code should use ToIntegral or the ParseInt* functions
// which provide parse error feedback.
//
// The goal of LocaleIndependentAtoi is to replicate the defined behaviour of
// std::atoi as it behaves under the "C" locale, and remove some undefined
// behavior. If the parsed value is bigger than the integer type's maximum
// value, or smaller than the integer type's minimum value, std::atoi has
// undefined behavior, while this function returns the maximum or minimum
// values, respectively.
```
ACKs for top commit:
MarcoFalke:
lgtm ACK da347de530242ead8f6a9718ee1440385bd3d44d
Tree-SHA512: c8f4cd9cff1fb3ea367ac9dbe5aa45dc187fc60114f2e2106e02e0e17fea4ee34d6e0c408fe920c2d8765e06b4dc30c231f0454fa35469c4399e0cadbcd341ba
Diffstat (limited to 'doc')
-rw-r--r-- | doc/developer-notes.md | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/doc/developer-notes.md b/doc/developer-notes.md index 40e5eb785f..ceaba8cb99 100644 --- a/doc/developer-notes.md +++ b/doc/developer-notes.md @@ -860,12 +860,12 @@ 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 `ParseInt32`, `ParseInt64`, `ParseUInt32`, `ParseUInt64`, `ParseDouble` from `utilstrencodings.h` for number parsing. +- 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. - Avoid using locale dependent functions if possible. You can use the provided - [`lint-locale-dependence.sh`](/test/lint/lint-locale-dependence.sh) + [`lint-locale-dependence.py`](/test/lint/lint-locale-dependence.py) to check for accidental use of locale dependent functions. - *Rationale*: Unnecessary locale dependence can cause bugs that are very tricky to isolate and fix. |