Skip to content

util: add missing include and fix function signature - #27192

Merged
fanquake merged 1 commit into
bitcoin:masterfrom
theuni:fix-readbinaryfile
Mar 4, 2023
Merged

fanquake merged 1 commit into
bitcoin:masterfrom
theuni:fix-readbinaryfile

Conversation

@theuni

@theuni theuni commented Mar 2, 2023 •

Copy link
Copy Markdown
Member

ping hebasto

Discovered while testing pre-compiled header support with CMake: https://github.com/theuni/bitcoin/commits/cmake-pch-poc. Compilation of that branch fails without this fix and succeeds with it.

Similar to the fix in #27144.

The problem of having a default argument in the definition was masked by the missing include. Using PCH forces that include, so we end up with the compiler error we should've been getting all along.

@DrahtBot

DrahtBot commented Mar 2, 2023 •

Copy link
Copy Markdown
Contributor

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

Reviews

See the guideline for information on the review process.

Type Reviewers
ACK fanquake
Stale ACK TheCharlatan

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

@sedited sedited left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

ACK 101601a1ff7ff8a0eb58171df1227dc7b006cbb9

@maflcko maflcko left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

lgtm

Comment thread src/util/readwritefile.cpp Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

nit: Including the own module goes on the first line/section, usually, to catch missing includes in the header file.

Also, could add it to iwyu in ci/test/06_...sh, so that reviewers can look at the ci output if they want?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Reordered. I think this change is simple enough for manual review :)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Yeah, I was mostly thinking that it would be good to check for other missing includes while touching the file, so that it doesn't have to be touched again later if there is a missing stdlib include or so.

@theuni
theuni force-pushed the fix-readbinaryfile branch from 101601a to 8847ce4 Compare March 3, 2023 22:19

@fanquake fanquake left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

ACK 8847ce4

@DrahtBot
DrahtBot requested a review from sedited March 4, 2023 07:15
@fanquake
fanquake merged commit 40c6c85 into bitcoin:master Mar 4, 2023
@hebasto

hebasto commented Mar 6, 2023

Copy link
Copy Markdown
Member

Post-merge ACK.

@bitcoin bitcoin locked and limited conversation to collaborators Mar 5, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants