Print log/error messages on stderr, not stdout
There are a couple of places where libc++ prints log/error messages to
stdout on its own. This may of course interfere with the output
generated with applications. Log/error messages should be directed to
stderr instead.
Differential Revision: http://reviews.llvm.org/D8135
Reviewed by: marshall
llvm-svn: 231767
Cr-Mirrored-From: sso://chromium.googlesource.com/_direct/external/github.com/llvm/llvm-project
Cr-Mirrored-Commit: c19393c758e0e7d24fa39ef00c8a6a7beeb731ad
diff --git a/src/exception.cpp b/src/exception.cpp
index b5c46c0..07983ce 100644
--- a/src/exception.cpp
+++ b/src/exception.cpp
@@ -90,14 +90,14 @@
#endif // _LIBCPP_NO_EXCEPTIONS
(*get_terminate())();
// handler should not return
- printf("terminate_handler unexpectedly returned\n");
+ fprintf(stderr, "terminate_handler unexpectedly returned\n");
::abort();
#ifndef _LIBCPP_NO_EXCEPTIONS
}
catch (...)
{
// handler should not throw exception
- printf("terminate_handler unexpectedly threw an exception\n");
+ fprintf(stderr, "terminate_handler unexpectedly threw an exception\n");
::abort();
}
#endif // _LIBCPP_NO_EXCEPTIONS
@@ -117,7 +117,7 @@
# else
# warning uncaught_exception not yet implemented
# endif
- printf("uncaught_exception not yet implemented\n");
+ fprintf(stderr, "uncaught_exception not yet implemented\n");
::abort();
#endif // __APPLE__
}
@@ -190,7 +190,7 @@
# else
# warning exception_ptr not yet implemented
# endif
- printf("exception_ptr not yet implemented\n");
+ fprintf(stderr, "exception_ptr not yet implemented\n");
::abort();
#endif
}
@@ -209,7 +209,7 @@
# else
# warning exception_ptr not yet implemented
# endif
- printf("exception_ptr not yet implemented\n");
+ fprintf(stderr, "exception_ptr not yet implemented\n");
::abort();
#endif
}
@@ -234,7 +234,7 @@
# else
# warning exception_ptr not yet implemented
# endif
- printf("exception_ptr not yet implemented\n");
+ fprintf(stderr, "exception_ptr not yet implemented\n");
::abort();
#endif
}
@@ -278,7 +278,7 @@
# else
# warning exception_ptr not yet implemented
# endif
- printf("exception_ptr not yet implemented\n");
+ fprintf(stderr, "exception_ptr not yet implemented\n");
::abort();
#endif
}
@@ -300,7 +300,7 @@
# else
# warning exception_ptr not yet implemented
# endif
- printf("exception_ptr not yet implemented\n");
+ fprintf(stderr, "exception_ptr not yet implemented\n");
::abort();
#endif
}