summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX/warn-memset-bad-sizeof.cpp
diff options
context:
space:
mode:
authorAnna Zaks <ganna@apple.com>2012-02-01 19:08:57 +0000
committerAnna Zaks <ganna@apple.com>2012-02-01 19:08:57 +0000
commit314cd09b5c79fcf2173e5650f4a470af673844f8 (patch)
tree39636809fc2fdab1a4050bfb476f464f2c0a2984 /clang/test/SemaCXX/warn-memset-bad-sizeof.cpp
parentfdad6794ac8008bea0413fb5c7468f80ca392ca3 (diff)
downloadbcm5719-llvm-314cd09b5c79fcf2173e5650f4a470af673844f8.tar.gz
bcm5719-llvm-314cd09b5c79fcf2173e5650f4a470af673844f8.zip
Add a new compiler warning, which flags anti-patterns used as the size
argument in strncat. The warning is ignored by default since it needs more qualification. TODO: The warning message and the note are messy when strncat is a builtin due to the macro expansion. llvm-svn: 149524
Diffstat (limited to 'clang/test/SemaCXX/warn-memset-bad-sizeof.cpp')
-rw-r--r--clang/test/SemaCXX/warn-memset-bad-sizeof.cpp2
1 files changed, 0 insertions, 2 deletions
diff --git a/clang/test/SemaCXX/warn-memset-bad-sizeof.cpp b/clang/test/SemaCXX/warn-memset-bad-sizeof.cpp
index a018223cbda..388e3627685 100644
--- a/clang/test/SemaCXX/warn-memset-bad-sizeof.cpp
+++ b/clang/test/SemaCXX/warn-memset-bad-sizeof.cpp
@@ -132,8 +132,6 @@ void strcpy_and_friends() {
strncpy(buff, BAR, sizeof(BAR)); // \
// expected-warning {{argument to 'sizeof' in 'strncpy' call is the same expression as the source}}
- strncat(buff, BAR, sizeof(BAR)); // \
- // expected-warning {{argument to 'sizeof' in 'strncat' call is the same expression as the source}}
strndup(FOO, sizeof(FOO)); // \
// expected-warning {{argument to 'sizeof' in 'strndup' call is the same expression as the source}}
}
OpenPOWER on IntegriCloud