From 21470fdeb383ba4ce1691049417ae49be1f2b66b Mon Sep 17 00:00:00 2001 From: Kittywhiskers Van Gogh <63189531+kwvg@users.noreply.github.com> Date: Tue, 7 Jun 2022 15:39:29 +0200 Subject: [PATCH] merge bitcoin#25292: Add LogPrintLevel to lint-format-strings, drop LogPrint-vs-LogPrintf section in dev notes --- doc/developer-notes.md | 5 ----- test/lint/lint-format-strings.sh | 1 + 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/doc/developer-notes.md b/doc/developer-notes.md index 7226447c51..8fe61e0f31 100644 --- a/doc/developer-notes.md +++ b/doc/developer-notes.md @@ -862,11 +862,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.sh b/test/lint/lint-format-strings.sh index ca4bc89258..21586d1cee 100755 --- a/test/lint/lint-format-strings.sh +++ b/test/lint/lint-format-strings.sh @@ -17,6 +17,7 @@ FUNCTION_NAMES_AND_NUMBER_OF_LEADING_ARGUMENTS=( "LogConnectFailure,1" "LogPrint,1" "LogPrintf,0" + "LogPrintLevel,2" "printf,0" "snprintf,2" "sprintf,1"