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 git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@231767 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
63e70b67eb
commit
e5a356a891
@ -22,7 +22,7 @@
|
|||||||
# include <cstdio>
|
# include <cstdio>
|
||||||
# include <cstddef>
|
# include <cstddef>
|
||||||
# ifndef _LIBCPP_ASSERT
|
# ifndef _LIBCPP_ASSERT
|
||||||
# define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : (_VSTD::printf("%s\n", m), _VSTD::abort()))
|
# define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : (_VSTD::fprintf(stderr, "%s\n", m), _VSTD::abort()))
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -90,14 +90,14 @@ terminate() _NOEXCEPT
|
|||||||
#endif // _LIBCPP_NO_EXCEPTIONS
|
#endif // _LIBCPP_NO_EXCEPTIONS
|
||||||
(*get_terminate())();
|
(*get_terminate())();
|
||||||
// handler should not return
|
// handler should not return
|
||||||
printf("terminate_handler unexpectedly returned\n");
|
fprintf(stderr, "terminate_handler unexpectedly returned\n");
|
||||||
::abort();
|
::abort();
|
||||||
#ifndef _LIBCPP_NO_EXCEPTIONS
|
#ifndef _LIBCPP_NO_EXCEPTIONS
|
||||||
}
|
}
|
||||||
catch (...)
|
catch (...)
|
||||||
{
|
{
|
||||||
// handler should not throw exception
|
// handler should not throw exception
|
||||||
printf("terminate_handler unexpectedly threw an exception\n");
|
fprintf(stderr, "terminate_handler unexpectedly threw an exception\n");
|
||||||
::abort();
|
::abort();
|
||||||
}
|
}
|
||||||
#endif // _LIBCPP_NO_EXCEPTIONS
|
#endif // _LIBCPP_NO_EXCEPTIONS
|
||||||
@ -117,7 +117,7 @@ bool uncaught_exception() _NOEXCEPT
|
|||||||
# else
|
# else
|
||||||
# warning uncaught_exception not yet implemented
|
# warning uncaught_exception not yet implemented
|
||||||
# endif
|
# endif
|
||||||
printf("uncaught_exception not yet implemented\n");
|
fprintf(stderr, "uncaught_exception not yet implemented\n");
|
||||||
::abort();
|
::abort();
|
||||||
#endif // __APPLE__
|
#endif // __APPLE__
|
||||||
}
|
}
|
||||||
@ -190,7 +190,7 @@ exception_ptr::~exception_ptr() _NOEXCEPT
|
|||||||
# else
|
# else
|
||||||
# warning exception_ptr not yet implemented
|
# warning exception_ptr not yet implemented
|
||||||
# endif
|
# endif
|
||||||
printf("exception_ptr not yet implemented\n");
|
fprintf(stderr, "exception_ptr not yet implemented\n");
|
||||||
::abort();
|
::abort();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
@ -209,7 +209,7 @@ exception_ptr::exception_ptr(const exception_ptr& other) _NOEXCEPT
|
|||||||
# else
|
# else
|
||||||
# warning exception_ptr not yet implemented
|
# warning exception_ptr not yet implemented
|
||||||
# endif
|
# endif
|
||||||
printf("exception_ptr not yet implemented\n");
|
fprintf(stderr, "exception_ptr not yet implemented\n");
|
||||||
::abort();
|
::abort();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
@ -234,7 +234,7 @@ exception_ptr& exception_ptr::operator=(const exception_ptr& other) _NOEXCEPT
|
|||||||
# else
|
# else
|
||||||
# warning exception_ptr not yet implemented
|
# warning exception_ptr not yet implemented
|
||||||
# endif
|
# endif
|
||||||
printf("exception_ptr not yet implemented\n");
|
fprintf(stderr, "exception_ptr not yet implemented\n");
|
||||||
::abort();
|
::abort();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
@ -278,7 +278,7 @@ exception_ptr current_exception() _NOEXCEPT
|
|||||||
# else
|
# else
|
||||||
# warning exception_ptr not yet implemented
|
# warning exception_ptr not yet implemented
|
||||||
# endif
|
# endif
|
||||||
printf("exception_ptr not yet implemented\n");
|
fprintf(stderr, "exception_ptr not yet implemented\n");
|
||||||
::abort();
|
::abort();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
@ -300,7 +300,7 @@ void rethrow_exception(exception_ptr p)
|
|||||||
# else
|
# else
|
||||||
# warning exception_ptr not yet implemented
|
# warning exception_ptr not yet implemented
|
||||||
# endif
|
# endif
|
||||||
printf("exception_ptr not yet implemented\n");
|
fprintf(stderr, "exception_ptr not yet implemented\n");
|
||||||
::abort();
|
::abort();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -39,7 +39,7 @@ void throw_helper( const string& msg )
|
|||||||
#ifndef _LIBCPP_NO_EXCEPTIONS
|
#ifndef _LIBCPP_NO_EXCEPTIONS
|
||||||
throw T( msg );
|
throw T( msg );
|
||||||
#else
|
#else
|
||||||
printf("%s\n", msg.c_str());
|
fprintf(stderr, "%s\n", msg.c_str());
|
||||||
abort();
|
abort();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user