Closed Bug 1677549 Opened 1 year ago Closed 5 months ago

Add guidelines on how/where to include headers resp. forward declare things to the coding style

Categories

(Firefox Build System :: Source Code Analysis, task)

task

Tracking

(firefox94 fixed)

RESOLVED FIXED
94 Branch
Tracking Status
firefox94 --- fixed

People

(Reporter: sg, Assigned: andi)

References

(Blocks 2 open bugs)

Details

Attachments

(1 file)

Currently, the coding style states on this topic:

Forward-declare classes in your header files, instead of including them, whenever possible. For example, if you have an interface with a void DoSomething(nsIContent* aContent) function, forward-declare with class nsIContent; instead of #include "nsIContent.h"

Given the current situation that Bug 1676346 tries to mitigate to some degree, these brief guidelines don't seem to be sufficient to keep include dependencies limited. More situations and possible mitigations should be described. Aspects that should be covered are e.g.

  • interaction with the unified and non-unified builds
  • IPDL files

When done, a heads-up should be given to dev-platform about this.

Component: IPC → Source Code Analysis
Product: Core → Firefox Build System
Depends on: 1677553
Blocks: 1679522
Pushed by sgiesecke@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/eb6cdd43ce2e
Add some guidelines on include directives and header files to the coding style. r=andi,sylvestre,asuth
Status: NEW → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 85 Branch
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Target Milestone: 85 Branch → ---
See Also: → 1682477
Assignee: simon.giesecke → bpostelnicu
Pushed by bpostelnicu@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/6f43446c07b7
Add some guidelines on include directives and header files to the coding style. r=asuth
Status: REOPENED → RESOLVED
Closed: 1 year ago5 months ago
Resolution: --- → FIXED
Target Milestone: --- → 94 Branch
You need to log in before you can comment on or make changes to this bug.