Remove unnecessary dependencies in script.cpp #4674

pull jtimon wants to merge 1 commits into bitcoin:master from jtimon:includescript changing 1 files +0 −10
  1. jtimon commented at 1:29 am on August 11, 2014: contributor
    Cleaning up includes that don’t seem necessary anymore.
  2. Remove unnecessary dependencies in script.cpp 54f048158b
  3. jgarzik commented at 1:32 am on August 11, 2014: contributor
    Several of the local includes are quite obviously used in script, such as crypto. NAK as-is.
  4. BitcoinPullTester commented at 1:43 am on August 11, 2014: none
    Automatic sanity-testing: PASSED, see http://jenkins.bluematt.me/pull-tester/p4674_54f048158b1b9864b5119c5f7dc3f126182288c0/ for binaries and test log. This test script verifies pulls every time they are updated. It, however, dies sometimes and fails to test properly. If you are waiting on a test, please check timestamps to verify that the test.log is moving at http://jenkins.bluematt.me/pull-tester/current/ Contact BlueMatt on freenode if something looks broken.
  5. jtimon commented at 3:03 am on August 11, 2014: contributor
    Those are included in hash, which is included in key, which is included in keystore. Otherwise the build would fail, no?
  6. sipa commented at 5:47 am on August 11, 2014: member

    You always want to include all direct dependencies of a file. Doing so makes it 1) clear which code you’re depending on and 2) makes the codebase robust against refactoring (for example, A depends on B, A and B both depend on C; B is changed to no longer need C… if A didn’t include C directly, this would cause build failures).

    As a general rule, an indirect dependency should not hide a direct dependency. There is one exception: if A.cpp and A.h both depend on B, it is omitted in the .cpp file (the .cpp and .h file are considered one unit).

  7. jgarzik commented at 6:03 am on August 11, 2014: contributor

    Using an #include says “I am using this API” It does not matter if other headers also use that API; you cannot depend on that fact, as indirect dependencies may change.

    This change makes the build more fragile and misunderstands how standard C/C++ header inclusion works.

  8. jgarzik closed this on Aug 11, 2014

  9. jtimon deleted the branch on Aug 11, 2014
  10. DrahtBot locked this on Sep 8, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-12-19 18:12 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me