diff options
author | Ted Kremenek <kremenek@apple.com> | 2010-09-09 03:51:42 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2010-09-09 03:51:42 +0000 |
commit | 95355bb53ef3145e463b98c6fd26f8f95e26e26c (patch) | |
tree | 62081976089bfe6aa9ba54b7781522d2c3c76e76 /test/Sema/format-strings.c | |
parent | 4fe6441a558e471f2ad3c6bddf07c77332539f6b (diff) |
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>.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113469 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Sema/format-strings.c')
-rw-r--r-- | test/Sema/format-strings.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/test/Sema/format-strings.c b/test/Sema/format-strings.c index 2325454c0b..9e8007b9b0 100644 --- a/test/Sema/format-strings.c +++ b/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 +} + |