[OB] Fix compilation errors with clang in gdb.base/advance.c

Message ID 1587485166-19174-1-git-send-email-gbenson@redhat.com
State New
Headers show
Series
  • [OB] Fix compilation errors with clang in gdb.base/advance.c
Related show

Commit Message

Simon Marchi via Gdb-patches April 21, 2020, 4:06 p.m.
Clang fails to compile the above file, with the following errors:
  warning: control reaches end of non-void function [-Wreturn-type]
  warning: too many arguments in call to 'func'

This prevents the following testcases from executing:
  gdb.base/advance.exp
  gdb.base/until-nodebug.exp

gdb/testsuite/ChangeLog:

	* gdb.base/advance.c (func): New argument, to match call site.
	(func2, func3): Add return statements.
---
 gdb/testsuite/ChangeLog          | 5 +++++
 gdb/testsuite/gdb.base/advance.c | 4 +++-
 2 files changed, 8 insertions(+), 1 deletion(-)

-- 
1.8.3.1

Patch

diff --git a/gdb/testsuite/gdb.base/advance.c b/gdb/testsuite/gdb.base/advance.c
index ab86b0e..a72cb13 100644
--- a/gdb/testsuite/gdb.base/advance.c
+++ b/gdb/testsuite/gdb.base/advance.c
@@ -16,9 +16,10 @@  int bar (int y)
 int func2 ()
 {
   x = 6;
+  return x;
 }
 
-void func()
+void func(int c)
 {
   x = x + 5;
   func2 ();
@@ -27,6 +28,7 @@  void func()
 int func3 ()
 {
   x = 4;
+  return x;
 }
 
 void marker1 ()