Skip to content

Commit 106b4c4

Browse files
authored
Map suppression names for irql-function-not-annotated
As noted at github/codeql#20611 the suppression query doesn't currently accept the warning code for query `irql-function-not-annotated`. Two related pieces of feedback-- 1. The help page at https://learn.microsoft.com/en-us/windows-hardware/drivers/devtest/static-tools-and-codeql?tabs=whcp%2Clatest#suppressing-codeql-results uses incorrect syntax `#pragma(suppress:the-rule-id-here)` -- should be `#pragma prefast(suppress:the-rule-id-here)` or `#pragma warning(suppress:the-rule-id-here)` 2. The regex used to recognise these pragmas is quite brittle; consider accepting spaces between `prefast` or `warning` and the parenthesis, so as to recognise e.g. `#pragma warning (suppress:the-rule-id-here)` Signed-off-by: Chris Smowton <smowton@github.com>
1 parent c91d068 commit 106b4c4

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

src/drivers/libraries/Suppression.qll

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,9 @@ abstract class CASuppression extends PreprocessorPragma {
110110
this.getRuleName() = any(["__WARNING_PROTOTYPE_MISMATCH", "28127"]) and
111111
result = "lgtm[cpp/drivers/routine-function-type-not-expected]"
112112
or
113+
this.getRuleName() = any(["__WARNING_UNEXPECTED_IRQL_CHANGE", "28167"]) and
114+
result = "lgtm[cpp/drivers/irql-function-not-annotated]"
115+
or
113116
result = "lgtm[" + this.getRuleName() + "]"
114117
}
115118
}

0 commit comments

Comments
 (0)