Code Monkey home page Code Monkey logo

Comments (3)

patricklodder avatar patricklodder commented on June 13, 2024

Example results when running iwyu with clang-14 against the files mentioned in #3377:

util/bip32.cpp

# python3 ../include-what-you-use/iwyu_tool.py src/util/bip32.cpp -p . -j6 -- -Xiwyu --cxx17ns

util/bip32.h should add these lines:
#include <stdint.h>      // for uint32_t

util/bip32.h should remove these lines:

The full include-list for util/bip32.h:
#include <attributes.h>  // for NODISCARD
#include <stdint.h>      // for uint32_t
#include <string>        // for string
#include <vector>        // for vector
---

util/bip32.cpp should add these lines:
#include <algorithm>            // for copy, max
#include <cstdint>              // for uint32_t

util/bip32.cpp should remove these lines:

The full include-list for util/bip32.cpp:
#include <util/bip32.h>
#include <stdio.h>              // for size_t
#include <tinyformat.h>         // for format, strprintf
#include <util/strencodings.h>  // for ParseUInt32
#include <algorithm>            // for copy, max
#include <cstdint>              // for uint32_t
#include <sstream>              // for basic_istream, stringstream
---

util/string.cpp

# python3 ../include-what-you-use/iwyu_tool.py src/util/string.cpp -p . -j6 -- -Xiwyu --cxx17ns

util/string.h should add these lines:
#include <stdint.h>      // for uint8_t

util/string.h should remove these lines:

The full include-list for util/string.h:
#include <attributes.h>  // for NODISCARD
#include <stdint.h>      // for uint8_t
#include <algorithm>     // for equal
#include <array>         // for array
#include <cstring>       // for strlen, size_t
#include <locale>        // for locale
#include <sstream>       // for ostringstream, basic_ios::imbue
#include <string>        // for string
#include <vector>        // for vector
---

(util/string.cpp has correct #includes/fwd-decls)

support/lockedpool.cpp

# python3 ../include-what-you-use/iwyu_tool.py src/support/lockedpool.cpp -p . -j6 -- -Xiwyu --cxx17ns

support/lockedpool.h should add these lines:
#include <stddef.h>       // for size_t

support/lockedpool.h should remove these lines:
- #include <stdint.h>  // lines 8-8

The full include-list for support/lockedpool.h:
#include <stddef.h>       // for size_t
#include <list>           // for list
#include <map>            // for multimap<>::const_iterator, multimap, multi...
#include <memory>         // for unique_ptr
#include <mutex>          // for call_once, mutex, once_flag
#include <unordered_map>  // for unordered_map
---

support/lockedpool.cpp should add these lines:
#include <ext/alloc_traits.h>  // for __alloc_traits<>::value_type
#include <limits>              // for numeric_limits
#include <stdexcept>           // for runtime_error
#include <utility>             // for pair, move

support/lockedpool.cpp should remove these lines:
- #include <config/bitcoin-config.h>  // lines 9-9
- #include <limits.h>  // lines 20-20

The full include-list for support/lockedpool.cpp:
#include <support/lockedpool.h>
#include <ext/alloc_traits.h>  // for __alloc_traits<>::value_type
#include <support/cleanse.h>   // for memory_cleanse
#include <sys/mman.h>          // for size_t, madvise, mlock, mmap, munlock
#include <sys/resource.h>      // for getrlimit, rlimit, RLIMIT_MEMLOCK, RLI...
#include <unistd.h>            // for sysconf, _SC_PAGESIZE
#include <algorithm>           // for min
#include <limits>              // for numeric_limits
#include <stdexcept>           // for runtime_error
#include <utility>             // for pair, move
---

from dogecoin.

chromatic avatar chromatic commented on June 13, 2024

👍 from me. I tested the same tool a few weeks ago and it looked useful.

The first item in your list seems like a good first issue too, though it might need the disclaimer "(for someone familiar with compiling)".

from dogecoin.

patricklodder avatar patricklodder commented on June 13, 2024

#3454 is another example of this being useful - running iwyu over src/bench solved an issue that is (likely) caused by a boost 1.84 header no longer including <limits>

from dogecoin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.