summaryrefslogtreecommitdiff
path: root/test/Analysis/string.c
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2013-12-22 00:07:40 +0000
committerDimitry Andric <dim@FreeBSD.org>2013-12-22 00:07:40 +0000
commitbfef399519ca9b8a4b4c6b563253bad7e0eeffe0 (patch)
treedf8df0b0067b381eab470a3b8f28d14a552a6340 /test/Analysis/string.c
parent6a0372513edbc473b538d2f724efac50405d6fef (diff)
Diffstat (limited to 'test/Analysis/string.c')
-rw-r--r--test/Analysis/string.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/test/Analysis/string.c b/test/Analysis/string.c
index 6cf52f7a557b..9fd3efb5c2d7 100644
--- a/test/Analysis/string.c
+++ b/test/Analysis/string.c
@@ -430,11 +430,12 @@ void strcat_unknown_src_length(char *src, int offset) {
// length for the "before" strlen, we won't be able to set one for "after".
void strcat_too_big(char *dst, char *src) {
+ // We assume this can never actually happen, so we don't get a warning.
if (strlen(dst) != (((size_t)0) - 2))
return;
if (strlen(src) != 2)
return;
- strcat(dst, src); // expected-warning{{This expression will create a string whose length is too big to be represented as a size_t}}
+ strcat(dst, src);
}
@@ -653,11 +654,12 @@ void strncat_unknown_limit(float limit) {
}
void strncat_too_big(char *dst, char *src) {
+ // We assume this will never actually happen, so we don't get a warning.
if (strlen(dst) != (((size_t)0) - 2))
return;
if (strlen(src) != 2)
return;
- strncat(dst, src, 2); // expected-warning{{This expression will create a string whose length is too big to be represented as a size_t}}
+ strncat(dst, src, 2);
}
void strncat_zero(char *src) {