diff options
author | Anna Zaks <ganna@apple.com> | 2012-08-07 18:36:58 +0000 |
---|---|---|
committer | Anna Zaks <ganna@apple.com> | 2012-08-07 18:36:58 +0000 |
commit | d43e114291eed272f8d7b735d3d1c4ca4cd04986 (patch) | |
tree | 11fa1144a59151d2ce043d1660623dbc8ad33e20 /test | |
parent | 67bf7dd9fa3aaa65c7105f77f265f05f35f235fd (diff) |
Turn on strncat-size warning implemented a while ago.
Warns on anti-patterns/typos in the 'size' argument to strncat. The
correct size argument should look like the following:
- strncat(dst, src, sizeof(dst) - strlen(dest) - 1);
We warn on:
- sizeof(dst)
- sizeof(src)
- sizeof(dst) - strlen(dst)
- sizeof(src) - anything
(This has been implemented in void Sema::CheckStrncatArguments().)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161440 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r-- | test/Analysis/cstring-syntax.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/test/Analysis/cstring-syntax.c b/test/Analysis/cstring-syntax.c index 64ecb67008..4aa88ed3b7 100644 --- a/test/Analysis/cstring-syntax.c +++ b/test/Analysis/cstring-syntax.c @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=unix.cstring.BadSizeArg -analyzer-store=region -Wno-strlcpy-strlcat-size -Wno-sizeof-array-argument -Wno-sizeof-pointer-memaccess -verify %s +// RUN: %clang_cc1 -analyze -analyzer-checker=unix.cstring.BadSizeArg -analyzer-store=region -Wno-strncat-size -Wno-strlcpy-strlcat-size -Wno-sizeof-array-argument -Wno-sizeof-pointer-memaccess -verify %s typedef __SIZE_TYPE__ size_t; char *strncat(char *, const char *, size_t); |