[PATCH] D80210: [analyzer] Turn off reports in system headers

Artem Dergachev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jun 4 05:24:45 PDT 2020


NoQ added a comment.

Eg., suppress this report:

  // system_header.h
  int bar() {
    int *x = NULL;
    return *x;
  }
  // user_file.c
  void foo() {
    bar();
  }

but don't suppress this report:

  // system_header.h
  int bar(int *x) {
    return *x;
  }
  // user_file.c
  void foo() {
    int *y = NULL;
    bar(y);
  }

In the first example there are two interesting events: (1) `x = NULL`, (2) `return *x` but both of them are in the system header. In the second example the interesting event (1) `y = NULL` is not in the system header, so the report remains.

> That all other interesting stack frames are nested in it

I think this is the best take. A more aggressive suppression would be "all interesting things are in a system header", which would allow the suppressed bug report to temporarily leave the system header between interesting events.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D80210/new/

https://reviews.llvm.org/D80210





More information about the cfe-commits mailing list