From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id BE1B23857C48; Wed, 3 Jan 2024 10:08:04 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BE1B23857C48 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1704276484; bh=MjxnF3eeXRU38LrYE+6NzpGroCQIkIUmp2QE8jHpOTk=; h=From:To:Subject:Date:In-Reply-To:References:From; b=VEG3gspBk6peUfeeWDQBokq2SEUx5qWFN5NQYCtEltV1ylxbvPQpc25UWsVDGOXf/ pIG5HvvrFT1NgKkmAAMnrZQvRoBw+ULNkZi7evJwOhGH0/WbiRybsJqutJm90cr1Ss OoUjBz94GT/rIWUeoBlG1ApowSld9yLbTP6buSZw= From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/113202] std::find does not work with the maximum range of pointers Date: Wed, 03 Jan 2024 10:08:03 +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: 13.2.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: pinskia at gcc dot gnu.org X-Bugzilla-Status: RESOLVED X-Bugzilla-Resolution: INVALID 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: resolution bug_status 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=3D113202 Andrew Pinski changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |INVALID Status|UNCONFIRMED |RESOLVED --- Comment #7 from Andrew Pinski --- Note doing std::find(a, max) where max is outside of the array (or one elem= ent more than the array) is undefined code. Which means libstdc++ is working correctly.=20 I suspect you should just use strlen if you want to find the null character= in an unbounded array.=