From 5faf5d31fa634e1fdb576c4d9708cd4efa5ea310 Mon Sep 17 00:00:00 2001 From: Jean-Daniel Dupas Date: Fri, 27 Jan 2012 23:21:02 +0000 Subject: [PATCH] Remove the "C" in "implicitly declaring C library function" diagnostic because all functions are not C functions (i.e. NSLog). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149150 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/clang/Basic/DiagnosticSemaKinds.td | 2 +- test/Analysis/dead-stores.c | 2 +- test/Analysis/exercise-ps.c | 2 +- test/Rewriter/finally.m | 2 +- test/Sema/block-return.c | 2 +- test/Sema/implicit-builtin-decl.c | 2 +- test/SemaObjC/builtin_objc_lib_functions.m | 14 +++++++------- test/SemaObjC/builtin_objc_nslog.m | 4 ++-- test/SemaObjC/ivar-lookup-resolution-builtin.m | 2 +- 9 files changed, 16 insertions(+), 16 deletions(-) diff --git a/include/clang/Basic/DiagnosticSemaKinds.td b/include/clang/Basic/DiagnosticSemaKinds.td index c350917477..948236edc6 100644 --- a/include/clang/Basic/DiagnosticSemaKinds.td +++ b/include/clang/Basic/DiagnosticSemaKinds.td @@ -268,7 +268,7 @@ def warn_unreachable : Warning<"will never be executed">, /// Built-in functions. def ext_implicit_lib_function_decl : ExtWarn< - "implicitly declaring C library function '%0' with type %1">; + "implicitly declaring library function '%0' with type %1">; def note_please_include_header : Note< "please include the header <%0> or explicitly provide a " "declaration for '%1'">; diff --git a/test/Analysis/dead-stores.c b/test/Analysis/dead-stores.c index 56e38cb07c..4c0c1bc130 100644 --- a/test/Analysis/dead-stores.c +++ b/test/Analysis/dead-stores.c @@ -11,7 +11,7 @@ void f1() { void f2(void *b) { char *c = (char*)b; // no-warning char *d = b+1; // expected-warning {{never read}} expected-warning{{unused variable 'd'}} - printf("%s", c); // expected-warning{{implicitly declaring C library function 'printf' with type 'int (const char *, ...)'}} \ + printf("%s", c); // expected-warning{{implicitly declaring library function 'printf' with type 'int (const char *, ...)'}} \ // expected-note{{please include the header or explicitly provide a declaration for 'printf'}} } diff --git a/test/Analysis/exercise-ps.c b/test/Analysis/exercise-ps.c index 5dd1f3f12b..b592c330e6 100644 --- a/test/Analysis/exercise-ps.c +++ b/test/Analysis/exercise-ps.c @@ -18,6 +18,6 @@ void_typedef f2_helper(); static void f2(void *buf) { F12_typedef* x; x = f2_helper(); - memcpy((&x[1]), (buf), 1); // expected-warning{{implicitly declaring C library function 'memcpy' with type 'void *(void *, const void *}} \ + memcpy((&x[1]), (buf), 1); // expected-warning{{implicitly declaring library function 'memcpy' with type 'void *(void *, const void *}} \ // expected-note{{please include the header or explicitly provide a declaration for 'memcpy'}} } diff --git a/test/Rewriter/finally.m b/test/Rewriter/finally.m index ab5d8387cc..bb5375152b 100644 --- a/test/Rewriter/finally.m +++ b/test/Rewriter/finally.m @@ -2,7 +2,7 @@ int main() { @try { - printf("executing try"); // expected-warning{{implicitly declaring C library function 'printf' with type 'int (const char *, ...)'}} \ + printf("executing try"); // expected-warning{{implicitly declaring library function 'printf' with type 'int (const char *, ...)'}} \ // expected-note{{please include the header or explicitly provide a declaration for 'printf'}} return(0); // expected-warning{{rewriter doesn't support user-specified control flow semantics for @try/@finally (code may not execute properly)}} } @finally { diff --git a/test/Sema/block-return.c b/test/Sema/block-return.c index 70fb3e104e..e8c651652b 100644 --- a/test/Sema/block-return.c +++ b/test/Sema/block-return.c @@ -81,7 +81,7 @@ void foo4() { int (^xx)(const char *s) = ^(char *s) { return 1; }; // expected-error {{incompatible block pointer types initializing 'int (^)(const char *)' with an expression of type 'int (^)(char *)'}} int (*yy)(const char *s) = funk; // expected-warning {{incompatible pointer types initializing 'int (*)(const char *)' with an expression of type 'int (char *)'}} - int (^nested)(char *s) = ^(char *str) { void (^nest)(void) = ^(void) { printf("%s\n", str); }; next(); return 1; }; // expected-warning{{implicitly declaring C library function 'printf' with type 'int (const char *, ...)'}} \ + int (^nested)(char *s) = ^(char *str) { void (^nest)(void) = ^(void) { printf("%s\n", str); }; next(); return 1; }; // expected-warning{{implicitly declaring library function 'printf' with type 'int (const char *, ...)'}} \ // expected-note{{please include the header or explicitly provide a declaration for 'printf'}} } diff --git a/test/Sema/implicit-builtin-decl.c b/test/Sema/implicit-builtin-decl.c index d80414d5fe..8cdd36518e 100644 --- a/test/Sema/implicit-builtin-decl.c +++ b/test/Sema/implicit-builtin-decl.c @@ -1,6 +1,6 @@ // RUN: %clang_cc1 -fsyntax-only -verify %s void f() { - int *ptr = malloc(sizeof(int) * 10); // expected-warning{{implicitly declaring C library function 'malloc' with type}} \ + int *ptr = malloc(sizeof(int) * 10); // expected-warning{{implicitly declaring library function 'malloc' with type}} \ // expected-note{{please include the header or explicitly provide a declaration for 'malloc'}} \ // expected-note{{'malloc' is a builtin with type 'void *}} } diff --git a/test/SemaObjC/builtin_objc_lib_functions.m b/test/SemaObjC/builtin_objc_lib_functions.m index 1aa5c75b7c..956ee12573 100644 --- a/test/SemaObjC/builtin_objc_lib_functions.m +++ b/test/SemaObjC/builtin_objc_lib_functions.m @@ -1,29 +1,29 @@ // RUN: %clang_cc1 -x objective-c %s -fsyntax-only -verify // rdar://8592641 -Class f0() { return objc_getClass("a"); } // expected-warning {{implicitly declaring C library function 'objc_getClass' with type 'id (const char *)'}} \ +Class f0() { return objc_getClass("a"); } // expected-warning {{implicitly declaring library function 'objc_getClass' with type 'id (const char *)'}} \ // expected-note {{please include the header or explicitly provide a declaration for 'objc_getClass'}} // rdar://8735023 -Class f1() { return objc_getMetaClass("a"); } // expected-warning {{implicitly declaring C library function 'objc_getMetaClass' with type 'id (const char *)'}} \ +Class f1() { return objc_getMetaClass("a"); } // expected-warning {{implicitly declaring library function 'objc_getMetaClass' with type 'id (const char *)'}} \ // expected-note {{please include the header or explicitly provide a declaration for 'objc_getMetaClass'}} -void f2(id val) { objc_enumerationMutation(val); } // expected-warning {{implicitly declaring C library function 'objc_enumerationMutation' with type 'void (id)'}} \ +void f2(id val) { objc_enumerationMutation(val); } // expected-warning {{implicitly declaring library function 'objc_enumerationMutation' with type 'void (id)'}} \ // expected-note {{please include the header or explicitly provide a declaration for 'objc_enumerationMutation'}} -long double f3(id self, SEL op) { return objc_msgSend_fpret(self, op); } // expected-warning {{implicitly declaring C library function 'objc_msgSend_fpret' with type 'long double (id, SEL, ...)'}} \ +long double f3(id self, SEL op) { return objc_msgSend_fpret(self, op); } // expected-warning {{implicitly declaring library function 'objc_msgSend_fpret' with type 'long double (id, SEL, ...)'}} \ // expected-note {{please include the header or explicitly provide a declaration for 'objc_msgSend_fpret'}} id f4(struct objc_super *super, SEL op) { // expected-warning {{declaration of 'struct objc_super' will not be visible outside of this function}} - return objc_msgSendSuper(super, op); // expected-warning {{implicitly declaring C library function 'objc_msgSendSuper' with type 'id (void *, SEL, ...)'}} \ + return objc_msgSendSuper(super, op); // expected-warning {{implicitly declaring library function 'objc_msgSendSuper' with type 'id (void *, SEL, ...)'}} \ // expected-note {{please include the header or explicitly provide a declaration for 'objc_msgSendSuper'}} } id f5(id val, id *dest) { - return objc_assign_strongCast(val, dest); // expected-warning {{implicitly declaring C library function 'objc_assign_strongCast' with type 'id (id, id *)'}} \ + return objc_assign_strongCast(val, dest); // expected-warning {{implicitly declaring library function 'objc_assign_strongCast' with type 'id (id, id *)'}} \ // expected-note {{please include the header or explicitly provide a declaration for 'objc_assign_strongCast'}} } int f6(Class exceptionClass, id exception) { - return objc_exception_match(exceptionClass, exception); // expected-warning {{implicitly declaring C library function 'objc_exception_match' with type 'int (id, id)'}} \ + return objc_exception_match(exceptionClass, exception); // expected-warning {{implicitly declaring library function 'objc_exception_match' with type 'int (id, id)'}} \ // expected-note {{please include the header or explicitly provide a declaration for 'objc_exception_match'}} } diff --git a/test/SemaObjC/builtin_objc_nslog.m b/test/SemaObjC/builtin_objc_nslog.m index 7c84c5fe23..c940b16cdc 100644 --- a/test/SemaObjC/builtin_objc_nslog.m +++ b/test/SemaObjC/builtin_objc_nslog.m @@ -3,11 +3,11 @@ #include void f1(id arg) { - NSLog(@"%@", arg); // expected-warning {{implicitly declaring C library function 'NSLog' with type 'void (id, ...)'}} \ + NSLog(@"%@", arg); // expected-warning {{implicitly declaring library function 'NSLog' with type 'void (id, ...)'}} \ // expected-note {{please include the header or explicitly provide a declaration for 'NSLog'}} } void f2(id str, va_list args) { - NSLogv(@"%@", args); // expected-warning {{implicitly declaring C library function 'NSLogv' with type }} \ + NSLogv(@"%@", args); // expected-warning {{implicitly declaring library function 'NSLogv' with type }} \ // expected-note {{please include the header or explicitly provide a declaration for 'NSLogv'}} } diff --git a/test/SemaObjC/ivar-lookup-resolution-builtin.m b/test/SemaObjC/ivar-lookup-resolution-builtin.m index 2e90e8e044..1254c1299d 100644 --- a/test/SemaObjC/ivar-lookup-resolution-builtin.m +++ b/test/SemaObjC/ivar-lookup-resolution-builtin.m @@ -28,7 +28,7 @@ @implementation Test1 - (int) InstMethod { - return index; // expected-warning {{implicitly declaring C library function 'index'}} \ + return index; // expected-warning {{implicitly declaring library function 'index'}} \ // expected-note {{please include the header or explicitly provide a declaration for 'index'}} \ // expected-warning {{incompatible pointer to integer conversion returning}} } -- 2.40.0