[PATCH] D71510: [clang][checkers] Added new checker 'error-return-checker'. (WIP)

Balázs Kéri via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jan 3 08:32:48 PST 2020


balazske added a comment.

Works relatively good now but not perfect. The tests are sometimes too strict so there are some false positives, for example this case:

  unsigned long X = strtoul("345", NULL, 10);
  if (X > 100) {
   // handle error
  }

The result is not checked for `ULONG_MAX` but still the code is correct in this way. But we can not figure out the intention of the programmer to detect what is an "error handling code" to check for error handling branches. Other solution is to detect any branch condition that involves the value (returned from the function) as a "test for error return value" but this is probably not better.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D71510





More information about the cfe-commits mailing list