Skip to contentSkip to conversation

fsx: fix compiler warning due to bad prototype

PATCH In review David Disseldorp 2 participants 2 messages Sep 30, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fsx: fix compiler warning due to bad prototype

I see the following with gcc 4.8.5 [-Wunprototyped-calls]:
warning: call to function 'cleanup' without a real prototype

Fix this by moving the function definition up, and dropping the prototype.

---
 ltp/fsx.c | 20 ++++++++------------
 1 file changed, 8 insertions(+), 12 deletions(-)
ltp/fsx.c +8 -12
index a7b36c1..ebe8ecf 100644
@@ -1272,7 +1272,14 @@ do {						\
 	TRIM_LEN(off, len, size);		\
 } while (0)
 
-void cleanup();
+void
+cleanup(int sig)
+{
+	if (sig)
+		prt("signal %d\n", sig);
+	prt("testcalls = %lu\n", testcalls);
+	exit(sig);
+}
 
 static int
 read_op(struct log_entry *log_entry)
@@ -1532,17 +1539,6 @@ out:
 
 
 void
-cleanup(sig)
-	int	sig;
-{
-	if (sig)
-		prt("signal %d\n", sig);
-	prt("testcalls = %lu\n", testcalls);
-	exit(sig);
-}
-
-
-void
 usage(void)
 {
 	fprintf(stdout, "usage: %s",
Signature · 1 line
2.6.6