]> granicus.if.org Git - clang/commit
[analyzer] CStringChecker: Remember to highlight the argument expression range.
authorArtem Dergachev <artem.dergachev@gmail.com>
Mon, 30 Jul 2018 23:44:37 +0000 (23:44 +0000)
committerArtem Dergachev <artem.dergachev@gmail.com>
Mon, 30 Jul 2018 23:44:37 +0000 (23:44 +0000)
commitad2e0ec8f1d875b882713994ba9d82f5bff3c2b2
tree38846fc772f3600ff739ff5e3277f274cb0b4f08
parentdeb3f2e47344cc2f82358ff7307ef609df9ee6f7
[analyzer] CStringChecker: Remember to highlight the argument expression range.

When emitting a bug report, it is important to highlight which argument of the
call-expression is causing the problem.

Before:
warning: Null pointer argument in call to string comparison function
  strcmp(a, b);
  ^~~~~~~~~~~~

After:
warning: Null pointer argument in call to string comparison function
  strcmp(a, b);
  ^      ~

Affects other output modes as well, not just text.

Differential Revision: https://reviews.llvm.org/D50028

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@338333 91177308-0d34-0410-b5e6-96231b3b80d8
lib/StaticAnalyzer/Checkers/CStringChecker.cpp
test/Analysis/cstring-ranges.c [new file with mode: 0644]