4
How to detect unused includes in C source code?
(alien.top)
A community for the timeless and infinitely powerful editor. Want to see what Emacs is capable of?!
clangd
and probably other linters can warn about this. False positives are possible, though: an include may very well be unused in a given build configuration, but enabled in another.