From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 9A3B33858401; Thu, 18 May 2023 15:08:15 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9A3B33858401 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1684422495; bh=KbVpY50zlqRL0Gnj6NLNCGnJoFdCmv+OPxFQOP0jmjM=; h=From:To:Subject:Date:In-Reply-To:References:From; b=JoeKoINOu3Uef66ZrMNgZ6jcz8i9snqS1SiQNa4Rzz0fzoA83jJXWrS0jqQRN87X9 4H5NqPui7wkenwG1lc7spiDj0tz/bCFOHIB01xn7f0OuWVdEC7xNWzLItFuMHsND2l qOSL9l/23hVufRR49yvlTATk9Jqhl9f1L7hGYmH4= From: "mimomorin at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/109891] Null pointer special handling in ostream's operator << for C-strings Date: Thu, 18 May 2023 15:08:14 +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: 14.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: mimomorin at gmail dot com X-Bugzilla-Status: UNCONFIRMED 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: 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D109891 --- Comment #6 from Michel Morin --- True. Detectable is not correct =E2=80=94 that's "maybe-detectable" at most= , and the bug is not silent. In a code that I checked, the buggy code (`std::cout << NullCharPtr;`) is the last printing call to std::cout, so I failed to see t= he side-effect. The patchlet using `_GLIBCXX_DEBUG_PEDASSERT` works fine. Actually I would = like `_GLIBCXX_DEBUG_ASSERT` (because I've been using `_GLIBCXX_DEBUG` but never `_GLIBCXX_DEBUG_PEDANTIC`), but I guess using `_GLIBCXX_DEBUG_PEDASSERT` ra= ther than `_GLIBCXX_DEBUG_ASSERT` in this case is a delibarate choice.=