From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gnu.wildebeest.org (gnu.wildebeest.org [45.83.234.184]) by sourceware.org (Postfix) with ESMTPS id AD8B73856099 for ; Mon, 6 Jun 2022 11:27:44 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org AD8B73856099 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=klomp.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=klomp.org Received: from tarox.wildebeest.org (83-87-18-245.cable.dynamic.v4.ziggo.nl [83.87.18.245]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by gnu.wildebeest.org (Postfix) with ESMTPSA id 728E73000B37; Mon, 6 Jun 2022 13:27:43 +0200 (CEST) Received: by tarox.wildebeest.org (Postfix, from userid 1000) id B162D4045495; Mon, 6 Jun 2022 13:27:41 +0200 (CEST) Message-ID: Subject: Re: [PATCH] gdb: Workaround stringop-overread warning in debuginfod-support.c on powerpc64 From: Mark Wielaard To: Pedro Alves , Simon Marchi , gdb-patches@sourceware.org Date: Mon, 06 Jun 2022 13:27:41 +0200 In-Reply-To: References: <20220511225219.119067-1-mark@klomp.org> <0f5c5a76969801002e5b2f9b224e6bdc58b41c1d.camel@klomp.org> <99342989-cf95-0194-bd61-1f41292e8c72@palves.net> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Mailer: Evolution 3.28.5 (3.28.5-10.el7) Mime-Version: 1.0 X-Spam-Status: No, score=-11.0 required=5.0 tests=BAYES_00, GIT_PATCH_0, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, KAM_NUMSUBJECT, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Jun 2022 11:27:46 -0000 Hi, On Tue, 2022-05-31 at 12:51 +0200, Mark Wielaard wrote: > On Tue, 2022-05-31 at 10:46 +0100, Pedro Alves wrote: > > I wonder whether sticking in an assert so that the compiler > > knows the size of array, would make the warning go away: >=20 > > diff --git c/gdb/debuginfod-support.c w/gdb/debuginfod-support.c > > index 6dc08fc29b6..d6fab39eac8 100644 > > --- c/gdb/debuginfod-support.c > > +++ w/gdb/debuginfod-support.c > > @@ -187,6 +187,8 @@ debuginfod_is_enabled () > > "from the following URLs:\n")); > > =20 > > gdb::string_view url_view (urls); > > + gdb_assert (url_view.size () < PTRDIFF_MAX); > > + > > while (true) > > { > > size_t off =3D url_view.find_first_not_of (' '); >=20 > I tried by hand, but that does result in the same warning (with the > DIAGNOSTIC_IGNORE_STRINGOP_OVERREAD removed): So, since that didn't work, OK to push the original patch that simply suppresses the diagnostic always? Thanks, Mark