gdb.mi/mi-pending.c: Return NULL instead of nothing in thread function
authorSimon Marchi <simon.marchi@ericsson.com>
Mon, 27 Jul 2015 19:49:24 +0000 (15:49 -0400)
committerSimon Marchi <simon.marchi@ericsson.com>
Mon, 27 Jul 2015 19:49:24 +0000 (15:49 -0400)
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
gdb/testsuite/gdb.mi/mi-pending.c

index 73bc2b65b15a8d37694d8b0db1ef0a8f88bf8d98..fd7c09c0bab37bb7e70813e11670e00b0de1bbdb 100644 (file)
@@ -1,3 +1,7 @@
+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.
index 248c7a8b0d7be53a2a5730952730da11084ebe19..2f3464e2eef2ab2b57ad7c4a5b29f1cee5cea748 100644 (file)
@@ -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) ();
 }
This page took 0.03069 seconds and 4 git commands to generate.