summaryrefslogtreecommitdiffstats
path: root/clang
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-02-17 16:03:01 +0000
committerDouglas Gregor <dgregor@apple.com>2009-02-17 16:03:01 +0000
commit7a0febe66d4d75841befbb7ea7e2555fa88b9f4d (patch)
tree3de803a6c2f32897b86877a6779714b6e644fe2e /clang
parentefe65e547bcddcb7de0aa2406ff69e08b1611621 (diff)
downloadbcm5719-llvm-7a0febe66d4d75841befbb7ea7e2555fa88b9f4d.tar.gz
bcm5719-llvm-7a0febe66d4d75841befbb7ea7e2555fa88b9f4d.zip
Remove the error about redefining library functions. It's causing too
much pain when compiling the Linux kernel (PR3592). llvm-svn: 64767
Diffstat (limited to 'clang')
-rw-r--r--clang/include/clang/Basic/DiagnosticSemaKinds.def4
-rw-r--r--clang/lib/Sema/SemaDecl.cpp8
-rw-r--r--clang/test/Sema/implicit-builtin-decl.c4
3 files changed, 4 insertions, 12 deletions
diff --git a/clang/include/clang/Basic/DiagnosticSemaKinds.def b/clang/include/clang/Basic/DiagnosticSemaKinds.def
index 3f7ad9a5caa..11db059c269 100644
--- a/clang/include/clang/Basic/DiagnosticSemaKinds.def
+++ b/clang/include/clang/Basic/DiagnosticSemaKinds.def
@@ -97,10 +97,6 @@ DIAG(warn_redecl_library_builtin, WARNING,
"incompatible redeclaration of library function %0 will be ignored")
DIAG(err_builtin_definition, ERROR,
"definition of builtin function %0")
-DIAG(err_builtin_lib_definition, ERROR,
- "definition of library function %0 in a hosted implementation")
-DIAG(note_builtin_lib_def_freestanding, NOTE,
- "use -ffreestanding to compile as a freestanding implementation")
/// parser diagnostics
DIAG(ext_typedef_without_a_name, EXTWARN,
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp
index bf6a637ac26..b5e6bd69739 100644
--- a/clang/lib/Sema/SemaDecl.cpp
+++ b/clang/lib/Sema/SemaDecl.cpp
@@ -2802,12 +2802,10 @@ Sema::DeclTy *Sema::ActOnStartOfFunctionDef(Scope *FnBodyScope, DeclTy *D) {
// Builtin functions cannot be defined.
if (unsigned BuiltinID = FD->getBuiltinID(Context)) {
- if (Context.BuiltinInfo.isPredefinedLibFunction(BuiltinID)) {
- Diag(FD->getLocation(), diag::err_builtin_lib_definition) << FD;
- Diag(FD->getLocation(), diag::note_builtin_lib_def_freestanding);
- } else
+ if (!Context.BuiltinInfo.isPredefinedLibFunction(BuiltinID)) {
Diag(FD->getLocation(), diag::err_builtin_definition) << FD;
- FD->setInvalidDecl();
+ FD->setInvalidDecl();
+ }
}
PushDeclContext(FnBodyScope, FD);
diff --git a/clang/test/Sema/implicit-builtin-decl.c b/clang/test/Sema/implicit-builtin-decl.c
index efaf3ed4553..4c28d8cf3eb 100644
--- a/clang/test/Sema/implicit-builtin-decl.c
+++ b/clang/test/Sema/implicit-builtin-decl.c
@@ -36,8 +36,6 @@ int f0() {
}
void * realloc(void *p, int size) { // expected-warning{{incompatible redeclaration of library function 'realloc' will be ignored}} \
-// expected-note{{'realloc' is a builtin with type 'void *(void *, unsigned long)'}} \
-// expected-error{{definition of library function 'realloc' in a hosted implementation}} \
- // expected-note{{use -ffreestanding to compile as a freestanding implementation}}
+// expected-note{{'realloc' is a builtin with type 'void *(void *, unsigned long)'}}
return p;
}
OpenPOWER on IntegriCloud