This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH obvious/pushed] gdb.mi/mi-pending.c: Return NULL instead of nothing in thread function
- From: Simon Marchi <simon dot marchi at ericsson dot com>
- To: <gdb-patches at sourceware dot org>
- Cc: Simon Marchi <simon dot marchi at ericsson dot com>
- Date: Mon, 27 Jul 2015 15:50:59 -0400
- Subject: [PATCH obvious/pushed] gdb.mi/mi-pending.c: Return NULL instead of nothing in thread function
- Authentication-results: sourceware.org; auth=none
FYI, I pushed this as obvious.
Using gcc 5.2 (maybe other versions as well), building mi-pending.c gives
these warnings:
./gdb.mi/mi-pending.c: In function âthread_funcâ:
./gdb.mi/mi-pending.c:34:5: warning: âreturnâ with no value, in function returning non-void
return;
^
./gdb.mi/mi-pending.c:38:5: warning: âreturnâ with no value, in function returning non-void
return;
^
gdb_compile_pthreads assumes that the build was successful only if there
is no output. These warnings therefore make gdb_compile_pthreads think
that the build failed, and the test doesn't run.
The easy fix is to replace the "return" with "return NULL". I am
pushing this as obvious.
gdb/testsuite/ChangeLog:
* gdb.mi/mi-pending.c (thread_func): Replace return with return
NULL.
---
gdb/testsuite/ChangeLog | 4 ++++
gdb/testsuite/gdb.mi/mi-pending.c | 4 ++--
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 73bc2b6..fd7c09c 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,5 +1,9 @@
2015-07-27 Simon Marchi <simon.marchi@ericsson.com>
+ * gdb.mi/mi-pending.c (thread_func): Replace return with return NULL.
+
+2015-07-27 Simon Marchi <simon.marchi@ericsson.com>
+
* gdb.mi/mi-watch.exp (test_watchpoint_triggering): Remove xfail.
2015-07-27 Patrick Palka <patrick@parcs.ath.cx>
diff --git a/gdb/testsuite/gdb.mi/mi-pending.c b/gdb/testsuite/gdb.mi/mi-pending.c
index 248c7a8..2f3464e 100644
--- a/gdb/testsuite/gdb.mi/mi-pending.c
+++ b/gdb/testsuite/gdb.mi/mi-pending.c
@@ -31,11 +31,11 @@ thread_func (void* arg)
h = dlopen (libname, RTLD_LAZY); /* set breakpoint here */
if (h == NULL)
- return;
+ return NULL;
p_func = dlsym (h, "pendfunc3");
if (p_func == NULL)
- return;
+ return NULL;
(*p_func) ();
}
--
2.1.4