2
0
mirror of https://gitlab.com/apparmor/apparmor synced 2025-09-01 06:45:38 +00:00

parser: begin deprecation process for #include

by adding a warning flag that is disabled by default. This will enable
devs to find when and where #include is in use by adding the compile
flag

  --warn=pound-include

and can even abort policy compiles by using

  --warn=pound-include --Werror=pound-include

The resulting messages look like

  Warning from /etc/apparmor.d/usr.sbin.cupsd (/etc/apparmor.d/usr.sbin.cupsd line 5): deprecated use of '#include'

Signed-off-by: John Johansen <john.johansen@canonical.com>
Acked-by: Time-out
This commit is contained in:
John Johansen
2022-07-28 15:03:39 -07:00
parent a382452a54
commit db246ddbb5
3 changed files with 8 additions and 2 deletions

View File

@@ -269,6 +269,7 @@ optflag_table_t warnflag_table[] = {
{ 1, "missing", "warn when missing qualifier and a default is used", WARN_MISSING },
{ 1, "override", "warn when overriding", WARN_OVERRIDE },
{ 1, "dev", "turn on warnings that are useful for profile development", WARN_DEV },
{ 1, "pound-include", "warn when #include is used", WARN_INCLUDE },
{ 1, "all", "turn on all warnings", WARN_ALL},
{ 0, NULL, NULL, 0 },
};