summaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.base
diff options
context:
space:
mode:
authorGary Benson <gbenson@redhat.com>2020-05-15 15:03:42 +0100
committerGary Benson <gbenson@redhat.com>2020-05-15 15:03:42 +0100
commit86e4e63d7cabb94a80a5ce767f670b65add5a083 (patch)
tree3d623c14d1475c21d0c7fc4076f4ae134e96fec9 /gdb/testsuite/gdb.base
parent163df4df08aa7b0dda75261c19832c8e66b2059c (diff)
downloadbinutils-gdb-86e4e63d7cabb94a80a5ce767f670b65add5a083.tar.gz
Fix "control reaches end of non-void function" errors in testsuite
When running the testsuite with clang, a number of testcases fail to build with the following errors: warning: control reaches end of non-void function [-Wreturn-type] warning: control may reach end of non-void function [-Wreturn-type] This prevents a number of testcases from executing. This commit fixes. gdb/testsuite/ChangeLog: * gdb.base/info-os.c (main): Add return statement. * gdb.base/info_minsym.c (minsym_fun): Likewise. * gdb.base/large-frame-2.c (func): Likewise. * gdb.base/pr10179-a.c (foo1, bar1): Likewise. * gdb.base/pr10179-b.c (foo2): Likewise. * gdb.base/valgrind-disp-step.c (foo): Likewise. * gdb.base/watch-cond.c (func): Likewise. * gdb.multi/goodbye.c (verylongfun): Likewise. * gdb.multi/hello.c (commonfun): Likewise. * gdb.python/py-finish-breakpoint.c (call_longjmp): Likewise. * gdb.threads/fork-plus-threads.c (thread_func): Likewise. * gdb.threads/forking-threads-plus-breakpoint.c (thread_forks): Likewise. * gdb.threads/hand-call-new-thread.c (foo): Likewise. * gdb.threads/interrupt-while-step-over.c (child_function): Likewise. * gdb.trace/actions-changed.c (end): Likewise.
Diffstat (limited to 'gdb/testsuite/gdb.base')
-rw-r--r--gdb/testsuite/gdb.base/info-os.c2
-rw-r--r--gdb/testsuite/gdb.base/info_minsym.c1
-rw-r--r--gdb/testsuite/gdb.base/large-frame-2.c1
-rw-r--r--gdb/testsuite/gdb.base/pr10179-a.c2
-rw-r--r--gdb/testsuite/gdb.base/pr10179-b.c1
-rw-r--r--gdb/testsuite/gdb.base/valgrind-disp-step.c1
-rw-r--r--gdb/testsuite/gdb.base/watch-cond.c1
7 files changed, 9 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.base/info-os.c b/gdb/testsuite/gdb.base/info-os.c
index f08407f02f2..5b88c2661ee 100644
--- a/gdb/testsuite/gdb.base/info-os.c
+++ b/gdb/testsuite/gdb.base/info-os.c
@@ -48,6 +48,8 @@ thread_proc (void *args)
{
pthread_mutex_lock (&mutex);
pthread_mutex_unlock (&mutex);
+
+ return NULL;
}
int
diff --git a/gdb/testsuite/gdb.base/info_minsym.c b/gdb/testsuite/gdb.base/info_minsym.c
index b4e3a3f3391..6f774b6fe68 100644
--- a/gdb/testsuite/gdb.base/info_minsym.c
+++ b/gdb/testsuite/gdb.base/info_minsym.c
@@ -20,6 +20,7 @@ static int minsym_var;
static int minsym_fun (void)
{
minsym_var++;
+ return 0;
}
int
diff --git a/gdb/testsuite/gdb.base/large-frame-2.c b/gdb/testsuite/gdb.base/large-frame-2.c
index bc2cc8482aa..7a88f57c5cd 100644
--- a/gdb/testsuite/gdb.base/large-frame-2.c
+++ b/gdb/testsuite/gdb.base/large-frame-2.c
@@ -22,4 +22,5 @@ func (void)
{
int a[4096];
blah (a);
+ return 0;
}
diff --git a/gdb/testsuite/gdb.base/pr10179-a.c b/gdb/testsuite/gdb.base/pr10179-a.c
index 56bce9df92e..584b1bc32a4 100644
--- a/gdb/testsuite/gdb.base/pr10179-a.c
+++ b/gdb/testsuite/gdb.base/pr10179-a.c
@@ -5,11 +5,13 @@ extern int foo2();
int
foo1()
{
+ return 0;
}
int
bar1()
{
+ return 0;
}
int
diff --git a/gdb/testsuite/gdb.base/pr10179-b.c b/gdb/testsuite/gdb.base/pr10179-b.c
index dcc5d9bb8b3..2f328ba5f39 100644
--- a/gdb/testsuite/gdb.base/pr10179-b.c
+++ b/gdb/testsuite/gdb.base/pr10179-b.c
@@ -3,4 +3,5 @@
int
foo2()
{
+ return 0;
}
diff --git a/gdb/testsuite/gdb.base/valgrind-disp-step.c b/gdb/testsuite/gdb.base/valgrind-disp-step.c
index 3a397ac1619..10de4aa2dc7 100644
--- a/gdb/testsuite/gdb.base/valgrind-disp-step.c
+++ b/gdb/testsuite/gdb.base/valgrind-disp-step.c
@@ -18,6 +18,7 @@
static int
foo (void)
{
+ return 0;
}
int
diff --git a/gdb/testsuite/gdb.base/watch-cond.c b/gdb/testsuite/gdb.base/watch-cond.c
index fe6fe9028f8..435f0b89c3d 100644
--- a/gdb/testsuite/gdb.base/watch-cond.c
+++ b/gdb/testsuite/gdb.base/watch-cond.c
@@ -23,6 +23,7 @@ int func(int *foo)
(*foo)++;
global++;
global2++;
+ return 0;
}
void func2(int *foo)