aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorMark Wielaard <mark@klomp.org>2022-05-03 23:17:31 +0000
committerMark Wielaard <mark@klomp.org>2022-05-04 16:07:59 +0200
commit716e54731f30bc60b2fc52996ebe4fc087420b2e (patch)
tree041b27d552dc090fecd5bf4582c757c3bc61e90d /gdb
parent5890af36e5112bcbb8d7555e63570f68466e6944 (diff)
downloadgdb-716e54731f30bc60b2fc52996ebe4fc087420b2e.zip
gdb-716e54731f30bc60b2fc52996ebe4fc087420b2e.tar.gz
gdb-716e54731f30bc60b2fc52996ebe4fc087420b2e.tar.bz2
gdb: Workaround stringop-overread warning in debuginfod-support.c on s390x
For some reason g++ 11.2.1 on s390x produces a spurious warning for stringop-overread in debuginfod_is_enabled for url_view. Add a new DIAGNOSTIC_IGNORE_STRINGOP_OVERREAD macro to suppress this warning. include/ChangeLog: * diagnostics.h (DIAGNOSTIC_IGNORE_STRINGOP_OVERREAD): New macro. gdb/ChangeLog: * debuginfod-support.c (debuginfod_is_enabled): Use DIAGNOSTIC_IGNORE_STRINGOP_OVERREAD on s390x.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/debuginfod-support.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/gdb/debuginfod-support.c b/gdb/debuginfod-support.c
index dffcd78..f2a31ea 100644
--- a/gdb/debuginfod-support.c
+++ b/gdb/debuginfod-support.c
@@ -17,6 +17,7 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
+#include "diagnostics.h"
#include <errno.h>
#include "gdbsupport/scoped_fd.h"
#include "debuginfod-support.h"
@@ -192,7 +193,17 @@ 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. */
+ DIAGNOSTIC_PUSH
+ DIAGNOSTIC_IGNORE_STRINGOP_OVERREAD
+#endif
off = url_view.find_first_of (' ');
+#if defined (__s390x__)
+ DIAGNOSTIC_POP
+#endif
gdb_printf
(_(" <%ps>\n"),
styled_string (file_name_style.style (),