Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: Fix bugprone-string-constructor warning #28741

Merged
merged 1 commit into from
Oct 30, 2023

Conversation

maflcko
Copy link
Member

@maflcko maflcko commented Oct 27, 2023

String literals in C++ have a trailing null character, so the current code is fine to rely on that implicitly. However,

  • the sqlite documentation explicitly mentions the null character
  • code readers may wonder if the code is intentional
  • clang-tidy warns about the code via bugprone-string-constructor

Address the points by putting the null character into the code and enable the clang-tidy bugprone-string-constructor check.

@DrahtBot
Copy link
Contributor

DrahtBot commented Oct 27, 2023

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Code Coverage

For detailed information about the code coverage, see the test coverage report.

Reviews

See the guideline for information on the review process.

Type Reviewers
ACK stickies-v
Stale ACK pablomartin4btc

If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

Copy link
Member

@pablomartin4btc pablomartin4btc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK fa3b6ef

src/wallet/db.cpp Outdated Show resolved Hide resolved
@maflcko maflcko force-pushed the 2310-bugprone-string-constructor- branch from fa3b6ef to fa56067 Compare October 30, 2023 13:59
Copy link
Contributor

@stickies-v stickies-v left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK fa56067

src/wallet/db.cpp Outdated Show resolved Hide resolved
@fanquake fanquake merged commit 4458ae8 into bitcoin:master Oct 30, 2023
15 of 16 checks passed
@maflcko maflcko deleted the 2310-bugprone-string-constructor- branch October 31, 2023 07:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants