summaryrefslogtreecommitdiffstats
path: root/clang/test/Sema/format-strings.c
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2010-09-09 03:51:42 +0000
committerTed Kremenek <kremenek@apple.com>2010-09-09 03:51:42 +0000
commit1520dae606e95a6343e293fb794d3cef31419b01 (patch)
tree756898566040b9c9fad6c875b1c8fc663fd9517d /clang/test/Sema/format-strings.c
parent808829351ee2a2465996acff6002282e8a412847 (diff)
downloadbcm5719-llvm-1520dae606e95a6343e293fb794d3cef31419b01.tar.gz
bcm5719-llvm-1520dae606e95a6343e293fb794d3cef31419b01.zip
It appears that technically a null format string is not warned under -Wformat-nonliteral, as
the function processing the format string can decided whether or not to accept a null format string (e.g., asl_log). Fixes <rdar://problem/8269537>. llvm-svn: 113469
Diffstat (limited to 'clang/test/Sema/format-strings.c')
-rw-r--r--clang/test/Sema/format-strings.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/clang/test/Sema/format-strings.c b/clang/test/Sema/format-strings.c
index 2325454c0b7..9e8007b9b02 100644
--- a/clang/test/Sema/format-strings.c
+++ b/clang/test/Sema/format-strings.c
@@ -301,3 +301,10 @@ void pr7981(wint_t c, wchar_t c2) {
printf("%lc", c2); // no-warning
}
+// <rdar://problem/8269537> -Wformat-security says NULL is not a string literal
+void r8269537() {
+ // This is likely to crash in most cases, but -Wformat-nonliteral technically
+ // doesn't warn in this case.
+ printf(0); // no-warning
+}
+
OpenPOWER on IntegriCloud