Re: [all pushed] Re: [PATCH 00/36] Support building GDB as a C++ program

asmwarrior
2015-05-15T08:24:45Z

There is another one build error:

In file included from ../../../binutils-gdb/gdb/gdbserver/server.h:61:0,
from ../../../binutils-gdb/gdb/gdbserver/server.c:19:
../../../binutils-gdb/gdb/gdbserver/target.h:442:50: error: second operand to the conditional operator is of type 'void', but the third operand is neither a throw-expression nor of type 'void'
(*the_target->handle_new_gdb_connection) () : 0)
^

The second operand is a function call which return void, so I have a simply changed the third operand like below: (maybe, we just need a simple if statement instead the conditional operator)

Yuanhui Zhang

Here is the patch:

gdb/gdbserver/target.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gdb/gdbserver/target.h b/gdb/gdbserver/target.h
index 8d23383..4affedf 100644
--- a/gdb/gdbserver/target.h
+++ b/gdb/gdbserver/target.h
@@ -439,7 +439,7 @@ int kill_inferior (int);

#define target_handle_new_gdb_connection() \
(the_target->handle_new_gdb_connection ? \
- (*the_target->handle_new_gdb_connection) () : 0)
+ (*the_target->handle_new_gdb_connection) () : (void)0)

#define detach_inferior(pid) \
(*the_target->detach) (pid)