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>
PR libstdc++/86590
......
......@@ -46,18 +46,25 @@
#include <bits/c++config.h>
#include <bits/functexcept.h>
#include <ctime>
#include <stdio.h>
#ifdef _GLIBCXX_HAVE_SYS_STAT_H
#include <sys/stat.h>
#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) \
do \
{ \
if (! (fn)) \
{ \
__builtin_printf("%s:%d: %s: Assertion '%s' failed.\n", \
__FILE__, __LINE__, __PRETTY_FUNCTION__, #fn); \
_VERIFY_PRINT("%s:%d: %s: Assertion '%s' failed.\n", \
__FILE__, __LINE__, __PRETTY_FUNCTION__, #fn); \
__builtin_abort(); \
} \
} while (false)
......
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