All the "test_" functions warn like:
src/gdb/testsuite/gdb.base/fileio.c: In function ‘test_close’:
src/gdb/testsuite/gdb.base/fileio.c:280:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
Nothing looks at the return of these functions, so just make them
return void. While at it, "()" is not the same as "(void)" in C - fix
that too.
gdb/ChangeLog:
2017-05-18 Pedro Alves <palves@redhat.com>
* gdb.base/fileio.c (stop, test_open, test_write, test_read)
(test_lseek, test_close, test_stat, test_fstat, test_isatty)
(test_system, test_rename, test_unlink, test_time): Change
prototypes.
* gdb.base/fileio.exp (stop_msg): Adjust.
+2017-05-18 Pedro Alves <palves@redhat.com>
+
+ * gdb.base/fileio.c (stop, test_open, test_write, test_read)
+ (test_lseek, test_close, test_stat, test_fstat, test_isatty)
+ (test_system, test_rename, test_unlink, test_time): Change
+ prototypes.
+ * gdb.base/fileio.exp (stop_msg): Adjust.
+
2017-05-18 Pedro Alves <palves@redhat.com>
* gdb.base/fileio.c (null_str): New global.
#define STRING "Hello World"
-static void stop () {}
+static void stop (void) {}
/* A NULL string. We pass this to stat below instead of a NULL
literal to avoid -Wnonnull warnings. */
const char *null_str;
-int
-test_open ()
+void
+test_open (void)
{
int ret;
stop ();
}
-int
-test_write ()
+void
+test_write (void)
{
int fd, ret;
stop ();
}
-int
-test_read ()
+void
+test_read (void)
{
int fd, ret;
char buf[16];
stop ();
}
-int
-test_lseek ()
+void
+test_lseek (void)
{
int fd;
off_t ret = 0;
stop ();
}
-int
-test_close ()
+void
+test_close (void)
{
int fd, ret;
stop ();
}
-int
-test_stat ()
+void
+test_stat (void)
{
int ret;
struct stat st;
stop ();
}
-int
-test_fstat ()
+void
+test_fstat (void)
{
int fd, ret;
struct stat st;
stop ();
}
-int
-test_isatty ()
+void
+test_isatty (void)
{
int fd;
char sys[1512];
-int
-test_system ()
+void
+test_system (void)
{
/*
* Requires test framework to switch on "set remote system-call-allowed 1"
stop ();
}
-int
-test_rename ()
+void
+test_rename (void)
{
int ret;
struct stat st;
char name[1256];
-int
-test_unlink ()
+void
+test_unlink (void)
{
int ret;
stop ();
}
-int
-test_time ()
+void
+test_time (void)
{
time_t ret, t;
gdb_test "break stop" "Breakpoint .*$srcfile.*"
-set stop_msg ".*Breakpoint .* stop \\(\\) at.*$srcfile:.*static void stop \\(\\) {}.*"
+set stop_msg ".*Breakpoint .* stop \\(\\) at.*$srcfile:.*static void stop \\(void\\) {}.*"
gdb_test continue \
"Continuing\\..*open 1:.*OK$stop_msg" \