aboutsummaryrefslogtreecommitdiff
path: root/test/Sema/format-strings.c
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2011-02-24 23:03:04 +0000
committerTed Kremenek <kremenek@apple.com>2011-02-24 23:03:04 +0000
commitb43e8ad893706a2499c4901b8f5cb289553d66b1 (patch)
treeedb911fa26449bdb18181492770993e347774a47 /test/Sema/format-strings.c
parent65d39251ff57b8e33cf6d3a7fcc6aa1c6f8cdc68 (diff)
Don't warn about using PredefinedExprs as format string literals. These never can be a real security issue.
Fixes PR 9314. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126447 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Sema/format-strings.c')
-rw-r--r--test/Sema/format-strings.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/Sema/format-strings.c b/test/Sema/format-strings.c
index fe4f4567cb..c78095a04d 100644
--- a/test/Sema/format-strings.c
+++ b/test/Sema/format-strings.c
@@ -350,3 +350,11 @@ void posix_extensions() {
void pr8486() {
printf("%s", 1); // expected-warning{{conversion specifies type 'char *' but the argument has type 'int'}}
}
+
+// PR9314
+// Don't warn about string literals that are PreDefinedExprs, e.g. __func__.
+void pr9314() {
+ printf(__PRETTY_FUNCTION__); // no-warning
+ printf(__func__); // no-warning
+}
+