From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2161) id 620CA385742D; Thu, 12 May 2022 10:41:18 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 620CA385742D Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Mark Wielaard To: gdb-cvs@sourceware.org Subject: [binutils-gdb] gdb: Workaround stringop-overread warning in debuginfod-support.c on powerpc64 X-Act-Checkin: binutils-gdb X-Git-Author: Mark Wielaard X-Git-Refname: refs/heads/master X-Git-Oldrev: d1fb8316b09ea35edaaa9a93e32a3adba51aef46 X-Git-Newrev: 73a5cb257a21ad38c85932b7be4a903404d91899 Message-Id: <20220512104118.620CA385742D@sourceware.org> Date: Thu, 12 May 2022 10:41:18 +0000 (GMT) X-BeenThere: gdb-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 May 2022 10:41:18 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D73a5cb257a21= ad38c85932b7be4a903404d91899 commit 73a5cb257a21ad38c85932b7be4a903404d91899 Author: Mark Wielaard Date: Thu May 12 00:46:37 2022 +0200 gdb: Workaround stringop-overread warning in debuginfod-support.c on po= werpc64 =20 Just like on s390x with g++ 11.2.1, ppc64le with g++ 11.3.1 produces a spurious warning for stringop-overread in debuginfod_is_enabled for url_view. Also suppress it on powerpc64. =20 gdb/ChangeLog: =20 * debuginfod-support.c (debuginfod_is_enabled): Use DIAGNOSTIC_IGNORE_STRINGOP_OVERREAD on powerpc64. Diff: --- gdb/debuginfod-support.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/gdb/debuginfod-support.c b/gdb/debuginfod-support.c index f2a31ea1952..6dc08fc29b6 100644 --- a/gdb/debuginfod-support.c +++ b/gdb/debuginfod-support.c @@ -193,15 +193,15 @@ debuginfod_is_enabled () if (off =3D=3D gdb::string_view::npos) break; url_view =3D url_view.substr (off); -#if defined (__s390x__) - /* g++ 11.2.1 on s390x seems convinced url_view might be of - SIZE_MAX length. And so complains because the length of - an array can only be PTRDIFF_MAX. */ +#if defined (__s390x__) || defined (__powerpc64__) + /* g++ 11.2.1 on s390x and g++ 11.3.1 on ppc64le seem convinced + url_view might be of SIZE_MAX length. And so complains + because the length of an array can only be PTRDIFF_MAX. */ DIAGNOSTIC_PUSH DIAGNOSTIC_IGNORE_STRINGOP_OVERREAD #endif off =3D url_view.find_first_of (' '); -#if defined (__s390x__) +#if defined (__s390x__) || defined (__powerpc64__) DIAGNOSTIC_POP #endif gdb_printf