diff options
author | Tom de Vries <tdevries@suse.de> | 2019-06-19 17:17:38 +0200 |
---|---|---|
committer | Tom de Vries <tdevries@suse.de> | 2019-06-19 17:17:38 +0200 |
commit | 8d6a48df549cce08ba1f05350f592be52352c7e8 (patch) | |
tree | badc465157702dcc6fb8d975c45e39a4cf63896c /gdb/gdbserver | |
parent | f23f598e28ad39dac7ae87cdc400d2f6b27dc403 (diff) | |
download | gdb-8d6a48df549cce08ba1f05350f592be52352c7e8.zip gdb-8d6a48df549cce08ba1f05350f592be52352c7e8.tar.gz gdb-8d6a48df549cce08ba1f05350f592be52352c7e8.tar.bz2 |
[gdb] Fix clang buildbreaker
Building gdb with clang, I run into:
...
src/gdb/gdbserver/linux-low.c:6190:41: error: comparison of unsigned \
expression < 0 is always false [-Werror,-Wtautological-compare]
if (debug_write ("sigchld_handler\n",
sizeof ("sigchld_handler\n") - 1) < 0)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~
...
This regression is introduced by commit a7e559cc08 "gdbserver: Ensure all
debug output uses debug functions", which replaces calls to write with result
type ssize_t with calls to debug_write with result type size_t.
Fix this by making debug_write return ssize_t.
Build and reg-tested on x86_64-linux.
gdb/gdbserver/ChangeLog:
2019-06-19 Tom de Vries <tdevries@suse.de>
* debug.h (debug_write): Change return type to ssize_t.
* debug.c (debug_write): Same.
Diffstat (limited to 'gdb/gdbserver')
-rw-r--r-- | gdb/gdbserver/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/gdbserver/debug.c | 2 | ||||
-rw-r--r-- | gdb/gdbserver/debug.h | 2 |
3 files changed, 7 insertions, 2 deletions
diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog index 22fc774..fad8fa5 100644 --- a/gdb/gdbserver/ChangeLog +++ b/gdb/gdbserver/ChangeLog @@ -1,3 +1,8 @@ +2019-06-19 Tom de Vries <tdevries@suse.de> + + * debug.h (debug_write): Change return type to ssize_t. + * debug.c (debug_write): Same. + 2019-06-14 Tom Tromey <tom@tromey.com> * configure.ac: Use new path to gnulib. diff --git a/gdb/gdbserver/debug.c b/gdb/gdbserver/debug.c index a1cf5db..19f11fc 100644 --- a/gdb/gdbserver/debug.c +++ b/gdb/gdbserver/debug.c @@ -133,7 +133,7 @@ do_debug_exit (const char *function_name) /* See debug.h. */ -size_t +ssize_t debug_write (const void *buf, size_t nbyte) { int fd = fileno (debug_file); diff --git a/gdb/gdbserver/debug.h b/gdb/gdbserver/debug.h index 29e58ad..07e94ea 100644 --- a/gdb/gdbserver/debug.h +++ b/gdb/gdbserver/debug.h @@ -36,7 +36,7 @@ void do_debug_enter (const char *function_name); void do_debug_exit (const char *function_name); /* Async signal safe debug output function that calls write directly. */ -size_t debug_write (const void *buf, size_t nbyte); +ssize_t debug_write (const void *buf, size_t nbyte); /* These macros are for use in major functions that produce a lot of debugging output. They help identify in the mass of debugging output |