public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] gdb: Workaround stringop-overread warning in debuginfod-support.c on powerpc64
@ 2022-05-11 22:52 Mark Wielaard
  2022-05-12  0:49 ` Simon Marchi
  0 siblings, 1 reply; 7+ messages in thread
From: Mark Wielaard @ 2022-05-11 22:52 UTC (permalink / raw)
  To: gdb-patches; +Cc: Mark Wielaard

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.

 gdb/ChangeLog:

    * debuginfod-support.c (debuginfod_is_enabled): Use
      DIAGNOSTIC_IGNORE_STRINGOP_OVERREAD on powerpc64.
---

Found with the new fedora-ppc64le builder:
https://builder.sourceware.org/buildbot/#/builders/gdb-fedora-ppc64le

Alternatively we could just suppress this warning for any architecture.

 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 == gdb::string_view::npos)
 	    break;
 	  url_view = 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 = url_view.find_first_of (' ');
-#if defined (__s390x__)
+#if defined (__s390x__) || defined (__powerpc64__)
 	  DIAGNOSTIC_POP
 #endif
 	  gdb_printf
-- 
2.30.2


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-06-06 16:42 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-11 22:52 [PATCH] gdb: Workaround stringop-overread warning in debuginfod-support.c on powerpc64 Mark Wielaard
2022-05-12  0:49 ` Simon Marchi
2022-05-31  9:05   ` Mark Wielaard
2022-05-31  9:46     ` Pedro Alves
2022-05-31 10:51       ` Mark Wielaard
2022-06-06 11:27         ` Mark Wielaard
2022-06-06 16:42           ` Pedro Alves

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).