[WIP, far from finished] Remove unnecessary includes #10573

pull practicalswift wants to merge 1 commits into bitcoin:master from practicalswift:remove-unneccessary-includes changing 69 files +0 −238
  1. practicalswift commented at 8:45 PM on June 11, 2017: contributor

    Remove unnecessary includes.

    WIP: This PR is *far* from finished. Submitting this version to trigger a Travis CI build to get testing on multiple platforms. Let's discuss which of these includes that should still be kept around despite being "technically redundant" and which we really want to remove.

  2. sipa commented at 8:51 PM on June 11, 2017: member

    NACK.

    You're removing includes of direct dependencies because they're already included indirectly. That results in fragile code that breaks when indirect dependencies change.

    In general, every .cpp and .h file should #include every header that it directly uses function/classes/definitions from, even if that's already implied by other dependencies. One exception is that a .cpp file does not need to re-include things that its corresponding .h already included.

  3. Remove unnecessary includes c1416a5caf
  4. practicalswift force-pushed on Jun 11, 2017
  5. practicalswift closed this on Jun 11, 2017

  6. practicalswift commented at 9:00 PM on June 11, 2017: contributor

    This PR is far from complete - it is a rough first version. Updated PR description.

    I'll try to find the subset of these includes that are not only "technically redundant" but also unnecessary in the sense that they don't reflect use.

    Let me know if you see any such instances right away from the list.

  7. practicalswift commented at 9:09 PM on June 11, 2017: contributor

    I will look into setting up my own Travis CI builds so that I don't pollute the main project with WIP PR:s to trigger Travis. Sorry about that!

  8. in src/base58.cpp:13 in c1416a5caf
       8 | -#include "uint256.h"
       9 |  
      10 | -#include <assert.h>
      11 | -#include <stdint.h>
      12 |  #include <string.h>
      13 | -#include <vector>
    


    luke-jr commented at 2:42 AM on June 12, 2017:

    std::vector is used in this file, so the include is necessary. I imagine this is true of many other removed includes...


    practicalswift commented at 2:46 AM on June 12, 2017:

    Yes, that's true! Please disregard this WIP PR (it shouldn't have been submitted in the first place - I should have found another way to trigger Travis CI testing), see the final PR "Remove includes in .cpp files for things the corresponding .h file already included" instead :-)

    Sorry about taking up reviewer time with this WIP stuff.

  9. practicalswift renamed this:
    Remove unnecessary includes
    [WIP, far from finished] Remove unnecessary includes
    on Jun 12, 2017
  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: 2026-04-16 15:15 UTC

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