It was noted in #12933 that the change to the header include policy was controversial and not agreed upon.
This reverts the guideline to its initial state.
It was noted in #12933 that the change to the header include policy was controversial and not agreed upon.
This reverts the guideline to its initial state.
This partially reverts commit fad0fc3c9a9759dfb2bb1bdf1aaa5e1d08c0ab9c.
Can be reviewed by checking out the commit and running:
$ git diff HEAD~2 HEAD ./doc/ | wc
0 0 0
ACK fa548e72c04110f058dfe3a11578dcf629d6906f
@ryanofsky (responding to your comment in #12933) As I mentioned, the ability to use iwyu seems like a good argument in favor of changing the policy. But then we should:
iwyuTo get specific, I guess the immediate question is whether to keep the sentence:
One exception is that a
.cppfile does not need to re-include the includes already included in its corresponding.hfile.
As Marco pointed out, since it says "does not need to" instead of "shouldn't", this isn't actually incompatible with iwyu like I originally thought in the other issue, so I wouldn't object to it anymore.
If there is going to be a bigger rewrite, I would like to see something like:
Every
.cppand.hfile should directly#includeheader files it needs definitions from, without relying on transitive includes from unrelated headers. See WhyIWYU for various considerations and rationale, and consider running the IWYU tool to automatically remove unneeded includes and add/remove forward declarations.
Admittedly, it is a little awkward right now to use iwyu with bitcoin, though I regularly do, and I previously posted instructions at #11878 (comment). It might be possible to add some build system support that would make iwyu easier to run, but I'd have to look into that.
Can we please not spend so much time on this :/
The back and forth on this, merging and reverting, why is this (which is pretty much just a style issue) suddenly such a contended topic.