Skip to content

Conversation

@smowton
Copy link

@smowton smowton commented Oct 13, 2025

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)

Checklist for Pull Requests

  • Description is filled out.
  • Only one query or related query group is in this pull request.
  • The version number on changed queries has been increased via the @version comment in the file header.
  • All unit tests have been run: (Test README.md).
  • Commands codeql database create and codeql database analyze have completed successfully.
  • A .qhelp file has been added for any new queries or updated if changes have been made to an existing query.

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 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant