diff options
author | Ryan Ofsky <ryan@ofsky.org> | 2024-08-06 14:30:49 -0400 |
---|---|---|
committer | Ryan Ofsky <ryan@ofsky.org> | 2024-08-06 15:41:38 -0400 |
commit | bb25e0691f656b7a971e0fb4d52ddda9eb4a2604 (patch) | |
tree | 86a3b6ca38d5ed1888fe30e1afcce2b903e38213 /src/validation.h | |
parent | d7333ece15b8a9c941af072cebc210b099900d0e (diff) | |
parent | fa18fc705084f3620be566d8c6639b29117ccf68 (diff) | |
download | bitcoin-bb25e0691f656b7a971e0fb4d52ddda9eb4a2604.tar.xz |
Merge bitcoin/bitcoin#30485: log: Remove NOLINT(bitcoin-unterminated-logprintf)
fa18fc705084f3620be566d8c6639b29117ccf68 log: Remove NOLINT(bitcoin-unterminated-logprintf) (MarcoFalke)
Pull request description:
`NOLINT(bitcoin-unterminated-logprintf)` is used to document a missing trailing `\n` char in the format string. This has many issues:
* It is just documentation, assuming that a trailing `\n` ends up in the formatted string. It is not enforced at compile-time, so it is brittle.
* If the newline was truly missing and `NOLINT(bitcoin-unterminated-logprintf)` were used to document a "continued" line, the log stream would be racy/corrupt, because any other thread may inject a log message in the meantime.
* If the newline was accidentally missing, nothing is there to correct the mistake.
* The intention of all code is to always end a log line with a new line. However, historic code exists to deal with the case where the new line was missing (`m_started_new_line`). This is problematic, because the presumed dead code has to be maintained (https://github.com/bitcoin/bitcoin/pull/30386#discussion_r1682963306).
Fix almost all issues by removing the `NOLINT(bitcoin-unterminated-logprintf)`, ensuring that a new line is always present.
A follow-up will remove the dead logging code.
ACKs for top commit:
TheCharlatan:
ACK fa18fc705084f3620be566d8c6639b29117ccf68
ryanofsky:
Code review ACK fa18fc705084f3620be566d8c6639b29117ccf68
Tree-SHA512: bf8a83723cca84e21187658edc19612da79c34f7ef2e1f6e9353e7ba70e4ecc0a878a2ae32290045fb90cba9a44451e35341a36ef2ec1169d13592393aa4a8ca
Diffstat (limited to 'src/validation.h')
0 files changed, 0 insertions, 0 deletions