From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 2E0E2386187E; Tue, 22 Nov 2022 10:58:36 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2E0E2386187E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1669114716; bh=rKnF9XuzLpIx5MPn4RDk7Iy6+HYfJFMYAxqJad22jko=; h=From:To:Subject:Date:In-Reply-To:References:From; b=o8hk2X99fMyOF7F+vXTtHvOIB5QOSv4Dnd6YzvZKbcAY77/BiIwXKLdl61J09XWgV zEdMLjtAR0aPTPvH1n6X8thcAZgoRU1ofgoNuF9oFYYR6II8/Hb3ltNrigI5Co9D7R gC7l3ymlNxEz7ZKUmg9z8ZdmUSFfKVS9Z5xlkZxo= From: "redi at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/107781] strchrnul' was not declared in this scope; did you mean 'strchr'? For contracts for canadian compilation Date: Tue, 22 Nov 2022 10:58:35 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 13.0 X-Bugzilla-Keywords: build X-Bugzilla-Severity: normal X-Bugzilla-Who: redi at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: jason 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=3D107781 --- Comment #4 from Jonathan Wakely --- If we don't want to introduce a configure check for strchrnul then this wou= ld work: --- a/gcc/cp/contracts.cc +++ b/gcc/cp/contracts.cc @@ -210,8 +210,8 @@ lookup_concrete_semantic (const char *name) static bool role_name_equal (const char *role, const char *name) { - size_t role_len =3D strchrnul (role, ':') - role; - size_t name_len =3D strchrnul (name, ':') - name; + size_t role_len =3D strcspn (role, ":"); + size_t name_len =3D strcspn (name, ":"); if (role_len !=3D name_len) return false; return strncmp (role, name, role_len) =3D=3D 0;=