iwyu is a tool for deciding which #include
s are needed, or not.
Including the right files, and no more, can speed up builds.
It also helps to show the dependencies of a file.
iwyu uses clang to create an AST for the code.
Configure + build NeoMutt with a compilation database.
./configure --compile-commands && make
Then run the main script with the source you wish to check:
iwyu.sh mutt/*.[ch]
Or with all files in the compilation database:
tac compile_commands.json | sed '2 s/.$//' | tac | jq -r '.[] | .file' | xargs ../iwyu/bin/iwyu.sh
Out of nearly 300 header files, most are correctly handled. The exceptions are the curses and ssl headers.