From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id E1FB5385382B; Wed, 17 May 2023 15:10:52 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E1FB5385382B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1684336252; bh=loRcDPshBQ47osbYAjli8gHz141hzvyXrzz7Q1cIhqs=; h=From:To:Subject:Date:In-Reply-To:References:From; b=Tlidlkeo3gQq5MuUo+k0Ni+AdrwCU3pqYZk/MydL37G3pX9g6nmMZ+CzDiSczVKhB vefgt9Rx00q0074Tzj7+Canfwqe6lynNfKYug6MkJg7ofTBkTO8I7NOff0p9xKrpf7 6uRVFE36TH6oTzScCu6Frg8DwOQgu7Qxt0Qc3fgo= 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: Wed, 17 May 2023 15:10:52 +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 #3 from Michel Morin --- >From the safety point of view, I agree with you. But, at the same time, I thought that detectable UB (with the help of sanitizers) is useful than sil= ent bug.=20 How about `throw`ing as in std::string's constructor?=