Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • Trac Trac
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Issues 246
    • Issues 246
    • List
    • Boards
    • Service Desk
    • Milestones
  • Monitor
    • Monitor
    • Metrics
    • Incidents
  • Analytics
    • Analytics
    • Value stream
  • Wiki
    • Wiki
  • Activity
  • Create a new issue
  • Issue Boards
Collapse sidebar
  • Legacy
  • TracTrac
  • Issues
  • #32655

Closed (moved)
(moved)
Open
Created Dec 02, 2019 by teor@teor

Try finding unused includes by compiling without each include

In #32522 (moved), we deleted some includes and PRIVATE defines, because they were duplicate (or the defines were never actually checked in the headers).

But we could go further, using this algorithm:

  1. Make sure all the files are sorted
  2. Find all the includes (and maybe PRIVATE defines)
  3. Delete the first include
  4. Try compiling
  5. If the include is required to compile, revert
  6. Try again from step 3, with the next include

We'd need to skip conditional includes, and check the results in CI before merging.

I'll wait until #32522 (moved) is reviewed, and also see if we want this task on our roadmap.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking