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 | f0267f5c9e3dbbfa19383330ac22aba112c64593 (patch) | |
| tree | 6807310569306ca515c35101c39969a58f1cc25f /clang/test/Analysis/cstring-syntax.c | |
| parent | 815f72bac7a839b8576923680b1a19c7574a5873 (diff) | |
| download | bcm5719-llvm-f0267f5c9e3dbbfa19383330ac22aba112c64593.tar.gz bcm5719-llvm-f0267f5c9e3dbbfa19383330ac22aba112c64593.zip | |
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().)
llvm-svn: 161440
Diffstat (limited to 'clang/test/Analysis/cstring-syntax.c')
| -rw-r--r-- | clang/test/Analysis/cstring-syntax.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/test/Analysis/cstring-syntax.c b/clang/test/Analysis/cstring-syntax.c index 64ecb67008f..4aa88ed3b7e 100644 --- a/clang/test/Analysis/cstring-syntax.c +++ b/clang/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); |

