From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id D0FA33858418; Mon, 18 Oct 2021 08:43:55 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D0FA33858418 From: "yfeldblum at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/59675] -D_GLIBCXX_DEBUG asserts to stdout (it should stderr) Date: Mon, 18 Oct 2021 08:43:55 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libstdc++ X-Bugzilla-Version: 9.2.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: yfeldblum at gmail dot com X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc attachments.created Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Oct 2021 08:43:55 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D59675 Jay Feldblum changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |yfeldblum at gmail dot com --- Comment #7 from Jay Feldblum --- Created attachment 51622 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=3D51622&action=3Dedit [PATCH] print extended assertion failures to stderr It is ordinarily expected that assertion failures go to stderr and that std= out 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 obse= rved 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 `. 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 ch= ange 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.=