5 ms·
> developers have a hope of being able to determine which #includes can be removed and which can't Can’t a modern compiler do that already? Didn’t google but s
by marhee 2y ago
> developers have a hope of being able to determine which #includes can be removed and which can't
Can’t a modern compiler do that already? Didn’t google but seems an obvious compiler feature at the very least behind a warning flag.
- vbezhenar 2y agoClang-tidy (linter) can do that. IMO it's a good idea to integrate this tool to any C project. I'm using gcc for embedded projects and clang-tidy works just fine as a separate tool. https://clang.llvm.org/extra/clang-tidy/checks/misc/include-cleaner.html https://clang.llvm.org/extra/clang-tidy/checks/misc/include-...
- blame-troi 2y agoI'm using https://github.com/include-what-you-use/include-what-you-use https://github.com/include-what-you-use/include-what-you-use in preference over clang-tidy.