https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59675

Jay Feldblum <yfeldblum at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |yfeldblum at gmail dot com

--- Comment #7 from Jay Feldblum <yfeldblum at gmail dot com> ---
Created attachment 51622
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=51622&action=edit
[PATCH] print extended assertion failures to stderr

It is ordinarily expected that assertion failures go to stderr and that stdout
be reserved for output intentionally produced by the application. Testing,
deployment, and monitoring infrastructures are often set up to match this
expectation.

A colleague recently noticed that some testing infrastructure at work does not
observe assertion failures from libstdc++ that would be expected to be observed
from building with `-D_GLIBCXX_ASSERTIONS`.

I have attached a patch - may we do something like it, or at least make
progress otherwise?

I read through the comments on this bug so far. It seems like there is some
desire to address this issue, with a caveat listed and with a suggestion
listed.

The caveat, not to pollute `bits/c++config` with `#include </* anything, really
*/>`. Are there more caveats to be aware of?

The suggestion, to export a helper routine that would work like `printf` but
emit to stderr. I can't tell whether that's a strong or weak preference. The
patch I went with - exporting a helper routine that returns the value of
`stderr` - is a bit smaller. But if that's not the preference then I can change
the patch.

Beyond the question of what helper routine to add, there is where to add it. I
cam e up with a guess but perhaps a better place will be suggested.

Reply via email to