Fix include directives
Summary
The current code base includes too many useless headers in most of its source code, particularly in its public interfaces headers. That is bad practice, increase compilation times and increase the number of files to be recompiled after an significant change.
In addition, some files miss include directives and depend on the include order. This must not happen.
Steps to reproduce
- Remove this line introduced as a bug fix in !11 (merged)
- Try to compile the RPC modules
- The compilation fails
The compilation failure was unexpected and had to be fixed in !11 (merged).
What is the expected correct behavior?
The code should always compile, no matter what the include order is and no matter what changes are done in the included files.
A complete MR must should include the following fixes:
-
Remove the useless includes, IWYU might help (use it by default? in the pre-commit hook? in the CI?) -
Remove the useless includes in the version.c
andversion.h
files (the xAQ dynamic version system is not to be used, see #39 (closed)) -
Fix the dependencies in the CMakeLists.txt
files -
Sort the includes in a reasonable order. This goes against WebKit guidelines, but can be trivially automatized with clang-format
(see the corresponding block of code and an example from the GitHub repository). The recommended sorting order is the LLVM's one.
Environment
- Version used: a4b119b6 or any previous commit
Possible fixes
Easy, but cumbersome changes.