mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-12-15 04:00:56 +00:00
67fdf81f0c
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 llvm-svn: 338333
16 lines
440 B
C
16 lines
440 B
C
// RUN: %clang_analyze_cc1 -analyzer-checker=unix.cstring -analyzer-output=text %s 2>&1 | FileCheck %s
|
|
|
|
// This test verifies argument source range highlighting.
|
|
// Otherwise we've no idea which of the arguments is null.
|
|
|
|
char *strcpy(char *, const char *);
|
|
|
|
void foo() {
|
|
char *a = 0, *b = 0;
|
|
strcpy(a, b);
|
|
}
|
|
|
|
// CHECK: warning: Null pointer argument in call to string copy function
|
|
// CHECK-NEXT: strcpy(a, b);
|
|
// CHECK-NEXT: ^ ~
|