mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-05-21 17:31:05 +02:00
Merge bitcoin/bitcoin#25292: Add LogPrintLevel to lint-format-strings, drop LogPrint-vs-LogPrintf section in dev notes
433b52569417674f84c2b1d449037701814420c4 Add LogPrintLevel to lint-format-strings, drop LogPrint-vs-LogPrintf section in dev notes (Jon Atack)
Pull request description:
added by #7003 in 2015, as that potential issue would now be caught by the `test/lint/lint-format-strings.py` script run by the CI.
ACKs for top commit:
MarcoFalke:
cr ACK 433b52569417674f84c2b1d449037701814420c4
w0xlt:
ACK 433b525694
Tree-SHA512: 91a2ac76689ed4f1f638e07c16d2ec8952fb013cc8bb896780fbd9333abd084281ce99afdc9de715d07a9abb4dce5dd67edf5e347aff466c6ef339ccc4158679
This commit is contained in:
commit
9dae9f5f1e
@ -831,11 +831,6 @@ int GetInt(Tabs tab)
|
|||||||
Strings and formatting
|
Strings and formatting
|
||||||
------------------------
|
------------------------
|
||||||
|
|
||||||
- Be careful of `LogPrint` versus `LogPrintf`. `LogPrint` takes a `category` argument, `LogPrintf` does not.
|
|
||||||
|
|
||||||
- *Rationale*: Confusion of these can result in runtime exceptions due to
|
|
||||||
formatting mismatch, and it is easy to get wrong because of subtly similar naming.
|
|
||||||
|
|
||||||
- Use `std::string`, avoid C string manipulation functions.
|
- Use `std::string`, avoid C string manipulation functions.
|
||||||
|
|
||||||
- *Rationale*: C++ string handling is marginally safer, less scope for
|
- *Rationale*: C++ string handling is marginally safer, less scope for
|
||||||
|
@ -22,6 +22,7 @@ FUNCTION_NAMES_AND_NUMBER_OF_LEADING_ARGUMENTS = [
|
|||||||
'LogConnectFailure,1',
|
'LogConnectFailure,1',
|
||||||
'LogPrint,1',
|
'LogPrint,1',
|
||||||
'LogPrintf,0',
|
'LogPrintf,0',
|
||||||
|
'LogPrintLevel,2',
|
||||||
'printf,0',
|
'printf,0',
|
||||||
'snprintf,2',
|
'snprintf,2',
|
||||||
'sprintf,1',
|
'sprintf,1',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user