diff options
author | Jon Atack <jon@atack.com> | 2022-06-07 15:39:29 +0200 |
---|---|---|
committer | Jon Atack <jon@atack.com> | 2022-06-07 15:56:26 +0200 |
commit | 433b52569417674f84c2b1d449037701814420c4 (patch) | |
tree | 19c176773e99b9aef382ee06d89ecedd45523b99 | |
parent | 45d8b1e94a8e3e68f210d496330f5e16219d2a8d (diff) | |
download | bitcoin-433b52569417674f84c2b1d449037701814420c4.tar.xz |
Add LogPrintLevel to lint-format-strings, drop LogPrint-vs-LogPrintf section in dev notes
that was added in 2015 by commit b8c06ef40 in PR 7003, as that potential issue
would now be caught by the test/lint/lint-format-strings.py script run by the CI
-rw-r--r-- | doc/developer-notes.md | 5 | ||||
-rwxr-xr-x | test/lint/lint-format-strings.py | 1 |
2 files changed, 1 insertions, 5 deletions
diff --git a/doc/developer-notes.md b/doc/developer-notes.md index 4843e61ee8..bd385efdfd 100644 --- a/doc/developer-notes.md +++ b/doc/developer-notes.md @@ -831,11 +831,6 @@ int GetInt(Tabs tab) 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. - *Rationale*: C++ string handling is marginally safer, less scope for diff --git a/test/lint/lint-format-strings.py b/test/lint/lint-format-strings.py index 28e7b1e4ff..412cf86791 100755 --- a/test/lint/lint-format-strings.py +++ b/test/lint/lint-format-strings.py @@ -22,6 +22,7 @@ FUNCTION_NAMES_AND_NUMBER_OF_LEADING_ARGUMENTS = [ 'LogConnectFailure,1', 'LogPrint,1', 'LogPrintf,0', + 'LogPrintLevel,2', 'printf,0', 'snprintf,2', 'sprintf,1', |