libstdc++: Print assertion messages to stderr [PR59675]
authorJonathan Wakely <jwakely@redhat.com>
Wed, 3 Nov 2021 16:06:29 +0000 (16:06 +0000)
committerJonathan Wakely <jwakely@redhat.com>
Fri, 12 Nov 2021 12:23:10 +0000 (12:23 +0000)
commita54ce8865a885bca5ab9c4aa6ec725cd13c09901
treef023249b8da983be57093f004e3eb94cc2d22b29
parent68d62cb20637b2faf2c2cc1716a0786b07a6a76f
libstdc++: Print assertion messages to stderr [PR59675]

This replaces the printf used by failed debug assertions with fprintf,
so we can write to stderr.

To avoid including <stdio.h> the assert function is moved into the
library. To avoid programs using a vague linkage definition of the old
inline function, the function is renamed. Code compiled with old
versions of GCC might still call the old function, but code compiled
with the newer GCC will call the new function and write to stderr.

libstdc++-v3/ChangeLog:

PR libstdc++/59675
* acinclude.m4 (libtool_VERSION): Bump version.
* config/abi/pre/gnu.ver (GLIBCXX_3.4.30): Add version and
export new symbol.
* configure: Regenerate.
* include/bits/c++config (__replacement_assert): Remove, declare
__glibcxx_assert_fail instead.
* src/c++11/debug.cc (__glibcxx_assert_fail): New function to
replace __replacement_assert, writing to stderr instead of
stdout.
* testsuite/util/testsuite_abi.cc: Update latest version.
libstdc++-v3/acinclude.m4
libstdc++-v3/config/abi/pre/gnu.ver
libstdc++-v3/configure
libstdc++-v3/include/bits/c++config
libstdc++-v3/src/c++11/debug.cc
libstdc++-v3/testsuite/util/testsuite_abi.cc