summaryrefslogtreecommitdiffstats
path: root/clang/test/Analysis/dead-stores.c
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-02-14 00:32:47 +0000
committerDouglas Gregor <dgregor@apple.com>2009-02-14 00:32:47 +0000
commitac5d4c5f8ec84453fe22a3c3b1bdb8ffd765423e (patch)
tree146387c45453bb4edb7bdff4ba294e2d7baa521f /clang/test/Analysis/dead-stores.c
parent6e1b2e36a5a8e27b07c9c3061621fe48d11fc031 (diff)
downloadbcm5719-llvm-ac5d4c5f8ec84453fe22a3c3b1bdb8ffd765423e.tar.gz
bcm5719-llvm-ac5d4c5f8ec84453fe22a3c3b1bdb8ffd765423e.zip
Extend builtin "attribute" syntax to include a notation for
printf-like functions, both builtin functions and those in the C library. The function-call checker now queries this attribute do determine if we have a printf-like function, rather than scanning through the list of "known functions IDs". However, there are 5 functions they are not yet "builtins", so the function-call checker handles them specifically still: - fprintf and vfprintf: the builtins mechanism cannot (yet) express FILE* arguments, so these can't be encoded. - NSLog: the builtins mechanism cannot (yet) express NSString* arguments, so this (and NSLogv) can't be encoded. - asprintf and vasprintf: these aren't part of the C99 standard library, so we really shouldn't be defining them as builtins in the general case (and we don't seem to have the machinery to make them builtins only on certain targets and depending on whether extensions are enabled). llvm-svn: 64512
Diffstat (limited to 'clang/test/Analysis/dead-stores.c')
-rw-r--r--clang/test/Analysis/dead-stores.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/test/Analysis/dead-stores.c b/clang/test/Analysis/dead-stores.c
index 7d7b3696379..2d07a8057b0 100644
--- a/clang/test/Analysis/dead-stores.c
+++ b/clang/test/Analysis/dead-stores.c
@@ -12,7 +12,8 @@ void f1() {
void f2(void *b) {
char *c = (char*)b; // no-warning
char *d = b+1; // expected-warning {{never read}}
- printf("%s", c);
+ printf("%s", c); // expected-warning{{implicitly declaring C library function 'printf' with type 'int (char const *, ...)'}} \
+ // expected-note{{please include the header <stdio.h> or explicitly provide a declaration for 'printf'}}
}
void f3() {
OpenPOWER on IntegriCloud