Skip to content

Migrate #pragma once to #ifndef *_H_ guards and catch backslides #133415

@matanlurey

Description

@matanlurey

We use #pragma once ~350 times.

Mostly in impeller/, 316 files, but also in lib/, 9 files, web_ui/, 4 files, and shell/, 10 files (including Fuchsia, Android) and more.

Unless there is a good reason we're only sometimes using it, I'd propose to replace the remainder of the guards (604 files), and ban it's recurrence.

Or, as @stuartmorgan brings up below, the opposite. There is a check to help enforce that:

llvm-header-guard

Metadata

Metadata

Assignees

Labels

P2Important issues not at the top of the work listc: tech-debtTechnical debt, code quality, testing, etc.engineflutter/engine related. See also e: labels.team-engineOwned by Engine teamtriaged-engineTriaged by Engine team

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions