Commit 4c6b0981 by Jonathan Wakely Committed by Jonathan Wakely

PR libstdc++/88740 Print assertion messages to stderr

	PR libstdc++/88740
	* testsuite/util/testsuite_hooks.h [stderr] (VERIFY): Use fprintf to
	write to stderr instead of using printf.

From-SVN: r268154
parent 494df875
2019-01-22 Jonathan Wakely <jwakely@redhat.com>
PR libstdc++/88740
* testsuite/util/testsuite_hooks.h [stderr] (VERIFY): Use fprintf to
write to stderr instead of using printf.
2019-01-21 Jakub Jelinek <jakub@redhat.com> 2019-01-21 Jakub Jelinek <jakub@redhat.com>
PR libstdc++/86590 PR libstdc++/86590
......
...@@ -46,17 +46,24 @@ ...@@ -46,17 +46,24 @@
#include <bits/c++config.h> #include <bits/c++config.h>
#include <bits/functexcept.h> #include <bits/functexcept.h>
#include <ctime> #include <ctime>
#include <stdio.h>
#ifdef _GLIBCXX_HAVE_SYS_STAT_H #ifdef _GLIBCXX_HAVE_SYS_STAT_H
#include <sys/stat.h> #include <sys/stat.h>
#endif #endif
#ifdef stderr
# define _VERIFY_PRINT(S, F, L, P, C) __builtin_fprintf(stderr, S, F, L, P, C)
#else
# define _VERIFY_PRINT(S, F, L, P, C) __builtin_printf(S, F, L, P, C)
#endif
#define VERIFY(fn) \ #define VERIFY(fn) \
do \ do \
{ \ { \
if (! (fn)) \ if (! (fn)) \
{ \ { \
__builtin_printf("%s:%d: %s: Assertion '%s' failed.\n", \ _VERIFY_PRINT("%s:%d: %s: Assertion '%s' failed.\n", \
__FILE__, __LINE__, __PRETTY_FUNCTION__, #fn); \ __FILE__, __LINE__, __PRETTY_FUNCTION__, #fn); \
__builtin_abort(); \ __builtin_abort(); \
} \ } \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment