mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-25 12:26:07 +00:00
11 lines
465 B
C
11 lines
465 B
C
// RUN: %clang_analyze_cc1 -verify %s -Wno-null-dereference \
|
|
// RUN: -analyzer-checker=core \
|
|
// RUN: -analyzer-checker=unix.cstring.NotNullTerminated \
|
|
// RUN: -analyzer-checker=debug.ExprInspection
|
|
|
|
char *strcpy(char *restrict s1, const char *restrict s2);
|
|
|
|
void strcpy_fn(char *x) {
|
|
strcpy(x, (char*)&strcpy_fn); // expected-warning{{Argument to string copy function is the address of the function 'strcpy_fn', which is not a null-terminated string}}
|
|
}
|