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

Proposal: Warn for #includes from which no symbols are actually used #236

Closed
ghost opened this issue Feb 5, 2022 · 1 comment
Closed
Labels
enhancement New feature or request

Comments

@ghost
Copy link

ghost commented Feb 5, 2022

In a similar vein to #234 (which I would have just amended with this but there's already #235 that closes it 😬), another warning for improper use of #include.

A new warning, -Wunused-include, triggers when there is an #include from which no symbols are used. This reduces unnecessary dependencies and the number of files to be reanalysed during incremental compilation1.

Footnotes

  1. https://github.com/include-what-you-use/include-what-you-use/blob/master/docs/WhyIWYU.md

@Vexu Vexu added the enhancement New feature or request label Feb 5, 2022
@ghost
Copy link
Author

ghost commented Feb 5, 2022

Oh. Oh wow.
Building Janet with this presents 215 warnings, of which 7 are from the project itself and maybe one is a true positive.

This was a bad idea.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant