From 433b52569417674f84c2b1d449037701814420c4 Mon Sep 17 00:00:00 2001 From: Jon Atack Date: Tue, 7 Jun 2022 15:39:29 +0200 Subject: 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 --- doc/developer-notes.md | 5 ----- test/lint/lint-format-strings.py | 1 + 2 files changed, 1 insertion(+), 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', -- cgit v1.2.3