Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[maintenence item] Remove transitive include dependencies #944

Open
ThisIsFineTM opened this issue Jan 9, 2025 · 0 comments
Open

[maintenence item] Remove transitive include dependencies #944

ThisIsFineTM opened this issue Jan 9, 2025 · 0 comments
Milestone

Comments

@ThisIsFineTM
Copy link
Contributor

ThisIsFineTM commented Jan 9, 2025

Reliance on transitive includes can make the codebase more fragile for refactoring efforts both within the library codebase and for dependent projects. I ran into this issue when experimenting with zim-tools, where libzim's version.h has a dependency on <iostream>, but if <iostream> isn't included before #include <zim/version.h> there is a build error.

LIBZIM_API void printVersions(std::ostream& out = std::cout);

https://github.com/openzim/zim-tools/blob/768cbe534156a44abe7678493c12e52b2a3194a3/src/version.h#L23

There is a clang tool called Include What You Use (IWYU) which can do most of the work for this (with some spot checking).

If this is approved I can put in a PR.

@kelson42 kelson42 added this to the 9.3.0 milestone Jan 9, 2025
@kelson42 kelson42 modified the milestones: 9.3.0, 10.0.0 Feb 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants