diff options
Diffstat (limited to 'clang/test/Analysis/bsd-string.c')
-rw-r--r-- | clang/test/Analysis/bsd-string.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/clang/test/Analysis/bsd-string.c b/clang/test/Analysis/bsd-string.c index e4119058507f..a7d06e71e978 100644 --- a/clang/test/Analysis/bsd-string.c +++ b/clang/test/Analysis/bsd-string.c @@ -12,12 +12,12 @@ size_t strlcat(char *dst, const char *src, size_t n); size_t strlen(const char *s); void clang_analyzer_eval(int); -void f1() { +void f1(void) { char overlap[] = "123456789"; strlcpy(overlap, overlap + 1, 3); // expected-warning{{Arguments must not be overlapping buffers}} } -void f2() { +void f2(void) { char buf[5]; size_t len; len = strlcpy(buf, "abcd", sizeof(buf)); // expected-no-warning @@ -26,33 +26,33 @@ void f2() { clang_analyzer_eval(len == 8); // expected-warning{{TRUE}} } -void f3() { +void f3(void) { char dst[2]; const char *src = "abdef"; strlcpy(dst, src, 5); // expected-warning{{String copy function overflows the destination buffer}} } -void f4() { +void f4(void) { strlcpy(NULL, "abcdef", 6); // expected-warning{{Null pointer passed as 1st argument to string copy function}} } -void f5() { +void f5(void) { strlcat(NULL, "abcdef", 6); // expected-warning{{Null pointer passed as 1st argument to string concatenation function}} } -void f6() { +void f6(void) { char buf[8]; strlcpy(buf, "abc", 3); size_t len = strlcat(buf, "defg", 4); clang_analyzer_eval(len == 7); // expected-warning{{TRUE}} } -int f7() { +int f7(void) { char buf[8]; return strlcpy(buf, "1234567", 0); // no-crash } -void f8(){ +void f8(void){ char buf[5]; size_t len; @@ -116,7 +116,7 @@ void f9(int unknown_size, char* unknown_src, char* unknown_dst){ // expected-warning@-1 {{String concatenation function overflows the destination buffer}} } -void f10(){ +void f10(void){ char buf[8]; size_t len; @@ -126,7 +126,7 @@ void f10(){ // expected-warning@-1 {{String concatenation function overflows the destination buffer}} } -void f11() { +void f11(void) { //test for Bug 41729 char a[256], b[256]; strlcpy(a, "world", sizeof(a)); @@ -135,7 +135,7 @@ void f11() { } int a, b; -void unknown_val_crash() { +void unknown_val_crash(void) { // We're unable to evaluate the integer-to-pointer cast. strlcat(&b, a, 0); // no-crash } |