Opened 6 months ago

Last modified 3 weeks ago

#32655 assigned task

Try finding unused includes by compiling without each include

Reported by: teor Owned by:
Priority: Medium Milestone: Tor: 0.4.4.x-final
Component: Core Tor/Tor Version:
Severity: Normal Keywords: teor-backlog, 043-deferred
Cc: nickm Actual Points:
Parent ID: #32522 Points: 3
Reviewer: Sponsor:


In #32522, 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 is reviewed, and also see if we want this task on our roadmap.

Child Tickets

Change History (4)

comment:1 Changed 6 months ago by teor

We need to remove cross-header dependencies using #32798, before this kind of script will give us good results.

comment:2 Changed 4 months ago by nickm

Keywords: 043-deferred added

All 0.4.3.x tickets without 043-must, 043-should, or 043-can are about to be deferred.

comment:3 Changed 4 months ago by nickm

Milestone: Tor: 0.4.3.x-finalTor: 0.4.4.x-final

comment:4 Changed 3 weeks ago by teor

Owner: teor deleted
Note: See TracTickets for help on using tickets.