[patch] add return values to return statements in non-void functions

David Blaikie dblaikie@gmail.com
Sat Apr 12 00:24:00 GMT 2014


These missing return values cause build breaks with clang which
defaults the -Wreturn-type warning to an error in this case.

Add the right return values so these tests can run when using clang.
-------------- next part --------------
commit ce1534e51863af5d935cdc63c44df0fa64a46653
Author: David Blaikie <dblaikie@gmail.com>
Date:   Fri Apr 11 17:20:49 2014 -0700

    Add return value for non-void function return statements to fix error in clang build.
    
    Clang defaults this warning to an error, breaking the build & causing
    these tests not to run.
    
    gdb/testsuite/
    
    	* gdb.mi/non-stop.c: Add return value for non-void function return
    	statement.
    	* gdb.threads/staticthreads.c: Ditto.

diff --git gdb/testsuite/ChangeLog gdb/testsuite/ChangeLog
index 12ed4f9..1b26439 100644
--- gdb/testsuite/ChangeLog
+++ gdb/testsuite/ChangeLog
@@ -1,3 +1,9 @@
+2014-04-10  David Blaikie <dblaikie@gmail.com>
+
+	* gdb.mi/non-stop.c: Add return value for non-void function return
+	statement.
+	* gdb.threads/staticthreads.c: Ditto.
+
 2014-04-10  Pedro Alves  <palves@redhat.com>
 
 	* gdb.base/cond-eval-mode.c: New file.
diff --git gdb/testsuite/gdb.mi/non-stop.c gdb/testsuite/gdb.mi/non-stop.c
index f03180e..67b68aa 100644
--- gdb/testsuite/gdb.mi/non-stop.c
+++ gdb/testsuite/gdb.mi/non-stop.c
@@ -56,7 +56,7 @@ worker (void *arg)
 	unslept = sleep (unslept);
 
       if (exit_first_thread && id == 0)
-	return;
+	return NULL;
 
       break_at_me (id, i);
     }
diff --git gdb/testsuite/gdb.threads/staticthreads.c gdb/testsuite/gdb.threads/staticthreads.c
index f98f4f1..e834d7f 100644
--- gdb/testsuite/gdb.threads/staticthreads.c
+++ gdb/testsuite/gdb.threads/staticthreads.c
@@ -37,7 +37,7 @@ thread_function (void *arg)
       if (errno != EINTR)
 	{
 	  perror ("thread_function");
-	  return;
+	  return NULL;
 	}
     }
   return NULL;


More information about the Gdb-patches mailing list