summaryrefslogtreecommitdiff
path: root/gdb/debuginfod-support.c
diff options
context:
space:
mode:
authorMark Wielaard <mark@klomp.org>2022-05-12 00:46:37 +0200
committerMark Wielaard <mark@klomp.org>2022-05-12 12:39:12 +0200
commit73a5cb257a21ad38c85932b7be4a903404d91899 (patch)
tree8ad975ac4cb7e8f12134be0daa611cbb089032ba /gdb/debuginfod-support.c
parentd1fb8316b09ea35edaaa9a93e32a3adba51aef46 (diff)
downloadbinutils-gdb-73a5cb257a21ad38c85932b7be4a903404d91899.tar.gz
gdb: Workaround stringop-overread warning in debuginfod-support.c on powerpc64
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.
Diffstat (limited to 'gdb/debuginfod-support.c')
-rw-r--r--gdb/debuginfod-support.c10
1 files 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