Blame SOURCES/ltrace-0.7.91-testsuite-includes.patch

920d6f
From 694d19ff14017926454771cbb63a22355b72f1bf Mon Sep 17 00:00:00 2001
920d6f
From: Faraz Shahbazker <faraz.shahbazker@imgtec.com>
920d6f
Date: Tue, 3 Feb 2015 13:07:55 -0800
920d6f
Subject: [PATCH] Fix missing includes and return statements in test sources
920d6f
920d6f
Fix warnings while compiling test cases by adding missing #includes and
920d6f
return statements. Missing arguments provided for functions wait()/wcswidth()
920d6f
---
920d6f
 testsuite/ltrace.main/filters.exp            | 1 +
920d6f
 testsuite/ltrace.main/main-internal.exp      | 4 +++-
920d6f
 testsuite/ltrace.main/main-threaded.c        | 1 +
920d6f
 testsuite/ltrace.main/parameters.c           | 1 +
920d6f
 testsuite/ltrace.main/parameters2.exp        | 2 +-
920d6f
 testsuite/ltrace.main/parameters3.exp        | 2 ++
920d6f
 testsuite/ltrace.main/system_call_params.exp | 4 ++++
920d6f
 testsuite/ltrace.minor/attach-process.exp    | 1 +
920d6f
 testsuite/ltrace.minor/libdl-simple.c        | 2 ++
920d6f
 testsuite/ltrace.minor/time-record.c         | 1 +
920d6f
 testsuite/ltrace.minor/trace-clone.c         | 2 ++
920d6f
 testsuite/ltrace.minor/trace-fork.c          | 4 +++-
920d6f
 testsuite/ltrace.minor/wchar.exp             | 3 ++-
920d6f
 testsuite/ltrace.torture/vfork-thread.c      | 1 +
920d6f
 14 files changed, 25 insertions(+), 4 deletions(-)
920d6f
920d6f
diff --git a/testsuite/ltrace.main/filters.exp b/testsuite/ltrace.main/filters.exp
920d6f
index 988346f..f7f4140 100644
920d6f
--- a/testsuite/ltrace.main/filters.exp
920d6f
+++ b/testsuite/ltrace.main/filters.exp
920d6f
@@ -22,6 +22,7 @@ set libfilt1 [ltraceCompile libfilt1.so [ltraceSource c {
920d6f
 }]]
920d6f
 
920d6f
 set libfilt2 [ltraceCompile libfilt2.so [ltraceSource c {
920d6f
+    #include <stdio.h>
920d6f
     void func2(void) { puts("func2"); }
920d6f
 }]]
920d6f
 
920d6f
diff --git a/testsuite/ltrace.main/main-internal.exp b/testsuite/ltrace.main/main-internal.exp
920d6f
index 0ca5e14..112c69b 100644
920d6f
--- a/testsuite/ltrace.main/main-internal.exp
920d6f
+++ b/testsuite/ltrace.main/main-internal.exp
920d6f
@@ -19,11 +19,13 @@
920d6f
 set bin [ltraceCompile {} [ltraceSource c {
920d6f
     __attribute__((noinline)) void this(void) {}
920d6f
     __attribute__((noinline)) void that(void) {}
920d6f
-    int main(int i) {
920d6f
+    int main() {
920d6f
+	int i;
920d6f
 	for (i = 0; i < 12; ++i) {
920d6f
 	    this();
920d6f
 	    that();
920d6f
 	}
920d6f
+	return 0;
920d6f
     }
920d6f
 }]]
920d6f
 
920d6f
diff --git a/testsuite/ltrace.main/parameters.c b/testsuite/ltrace.main/parameters.c
920d6f
index a3d8bb5..aa862b9 100644
920d6f
--- a/testsuite/ltrace.main/parameters.c
920d6f
+++ b/testsuite/ltrace.main/parameters.c
920d6f
@@ -17,6 +17,7 @@ void func_intptr_ret(int *i);
920d6f
 int func_strlen(char*);
920d6f
 void func_strfixed(char*);
920d6f
 void func_ppp(int***);
920d6f
+void func_string(char*);
920d6f
 void func_stringp(char**);
920d6f
 void func_short(short, short);
920d6f
 void func_ushort(unsigned short, unsigned short);
920d6f
diff --git a/testsuite/ltrace.main/parameters2.exp b/testsuite/ltrace.main/parameters2.exp
920d6f
index 9850079..1c7b3b4 100644
920d6f
--- a/testsuite/ltrace.main/parameters2.exp
920d6f
+++ b/testsuite/ltrace.main/parameters2.exp
920d6f
@@ -17,7 +17,7 @@
920d6f
 # 02110-1301 USA
920d6f
 
920d6f
 set trivial [ltraceCompile {} [ltraceSource c {
920d6f
-    int main(void) {}
920d6f
+    int main(void) {return 0;}
920d6f
 }]]
920d6f
 
920d6f
 ltraceMatch1 [ltraceRun -L -F [ltraceSource conf {
920d6f
diff --git a/testsuite/ltrace.main/parameters3.exp b/testsuite/ltrace.main/parameters3.exp
920d6f
index 693c219..f6d9116 100644
920d6f
--- a/testsuite/ltrace.main/parameters3.exp
920d6f
+++ b/testsuite/ltrace.main/parameters3.exp
920d6f
@@ -29,8 +29,10 @@ set liba [ltraceCompile liba.so [ltraceSource c {
920d6f
 }]]
920d6f
 
920d6f
 set bin [ltraceCompile {} $liba [ltraceSource c {
920d6f
+    extern void fun(void);
920d6f
     int main(void) {
920d6f
 	fun();
920d6f
+	return 0;
920d6f
     }
920d6f
 }]]
920d6f
 
920d6f
diff --git a/testsuite/ltrace.main/system_call_params.exp b/testsuite/ltrace.main/system_call_params.exp
920d6f
index 2ccf840..f3a55d2 100644
920d6f
--- a/testsuite/ltrace.main/system_call_params.exp
920d6f
+++ b/testsuite/ltrace.main/system_call_params.exp
920d6f
@@ -17,12 +17,15 @@
920d6f
 # 02110-1301 USA
920d6f
 
920d6f
 set bin [ltraceCompile {} [ltraceSource c {
920d6f
+    #ifndef _GNU_SOURCE
920d6f
     #define _GNU_SOURCE
920d6f
+    #endif
920d6f
     #include <sys/types.h>
920d6f
     #include <sys/stat.h>
920d6f
     #include <fcntl.h>
920d6f
     #include <unistd.h>
920d6f
     #include <sys/syscall.h>   /* For SYS_xxx definitions */
920d6f
+    #include <sys/mount.h>
920d6f
 
920d6f
     #ifndef SYS_open
920d6f
     # if defined(__aarch64__)
920d6f
@@ -38,6 +41,7 @@ set bin [ltraceCompile {} [ltraceSource c {
920d6f
 	syscall(SYS_open, "/some/path", O_RDONLY);
920d6f
 	write(1, "something", 10);
920d6f
 	mount("source", "target", "filesystemtype", 0, 0);
920d6f
+	return 0;
920d6f
     }
920d6f
 }]]
920d6f
 
920d6f
diff --git a/testsuite/ltrace.minor/attach-process.exp b/testsuite/ltrace.minor/attach-process.exp
920d6f
index 2c7d20c..c050f21 100644
920d6f
--- a/testsuite/ltrace.minor/attach-process.exp
920d6f
+++ b/testsuite/ltrace.minor/attach-process.exp
920d6f
@@ -21,6 +21,7 @@ set bin [ltraceCompile {} [ltraceSource c {
920d6f
     int main(void) {
920d6f
 	sleep(5);
920d6f
 	sleep(1);
920d6f
+	return 0;
920d6f
     }
920d6f
 }]]
920d6f
 
920d6f
diff --git a/testsuite/ltrace.minor/libdl-simple.c b/testsuite/ltrace.minor/libdl-simple.c
920d6f
index 0bef5cf..b1be002 100644
920d6f
--- a/testsuite/ltrace.minor/libdl-simple.c
920d6f
+++ b/testsuite/ltrace.minor/libdl-simple.c
920d6f
@@ -1,6 +1,7 @@
920d6f
 #include <stdlib.h>
920d6f
 #include <stdio.h>
920d6f
 #include <dlfcn.h>
920d6f
+#include <string.h>
920d6f
 
920d6f
 int main(int argc, char **argv) {
920d6f
 	void *handle;
920d6f
@@ -21,4 +22,5 @@ int main(int argc, char **argv) {
920d6f
 
920d6f
 	printf("%d\n", test(5));
920d6f
 	dlclose(handle);
920d6f
+	return 0;
920d6f
 }
920d6f
diff --git a/testsuite/ltrace.minor/time-record.c b/testsuite/ltrace.minor/time-record.c
920d6f
index a66b838..7d5e5e3 100644
920d6f
--- a/testsuite/ltrace.minor/time-record.c
920d6f
+++ b/testsuite/ltrace.minor/time-record.c
920d6f
@@ -5,6 +5,7 @@
920d6f
    This file was written by Yao Qi <qiyao@cn.ibm.com>.  */
920d6f
 #include <stdio.h>
920d6f
 #include <time.h>
920d6f
+#include <unistd.h>
920d6f
 
920d6f
 #define SLEEP_COUNT 2
920d6f
 #define NANOSLEEP_COUNT 50
920d6f
diff --git a/testsuite/ltrace.minor/trace-clone.c b/testsuite/ltrace.minor/trace-clone.c
920d6f
index ded930c..6aab235 100644
920d6f
--- a/testsuite/ltrace.minor/trace-clone.c
920d6f
+++ b/testsuite/ltrace.minor/trace-clone.c
920d6f
@@ -3,7 +3,9 @@
920d6f
    clone called.
920d6f
 
920d6f
    This file was written by Yao Qi <qiyao@cn.ibm.com>.  */
920d6f
+#ifndef _GNU_SOURCE
920d6f
 #define _GNU_SOURCE
920d6f
+#endif
920d6f
 #include <stdio.h>
920d6f
 #include <sys/types.h>
920d6f
 #include <stdlib.h>
920d6f
diff --git a/testsuite/ltrace.minor/trace-fork.c b/testsuite/ltrace.minor/trace-fork.c
920d6f
index c5f0c71..9611184 100644
920d6f
--- a/testsuite/ltrace.minor/trace-fork.c
920d6f
+++ b/testsuite/ltrace.minor/trace-fork.c
920d6f
@@ -6,6 +6,8 @@
920d6f
 
920d6f
 #include <stdio.h>
920d6f
 #include <sys/types.h>
920d6f
+#include <unistd.h>
920d6f
+#include <sys/wait.h>
920d6f
 
920d6f
 void 
920d6f
 child ()
920d6f
@@ -27,7 +29,7 @@ main ()
920d6f
   else
920d6f
     {
920d6f
       printf("My child pid is %d\n",pid);
920d6f
-      wait(); 
920d6f
+      wait(NULL);
920d6f
     }
920d6f
   return 0;
920d6f
 }
920d6f
diff --git a/testsuite/ltrace.torture/vfork-thread.c b/testsuite/ltrace.torture/vfork-thread.c
920d6f
index f909bd3..4c118a6 100644
920d6f
--- a/testsuite/ltrace.torture/vfork-thread.c
920d6f
+++ b/testsuite/ltrace.torture/vfork-thread.c
920d6f
@@ -13,6 +13,7 @@ routine (void *data)
920d6f
       puts ("bleble");
920d6f
       sleep (1);
920d6f
     }
920d6f
+  return NULL;
920d6f
 }
920d6f
 
920d6f
 
920d6f
-- 
920d6f
2.1.0
920d6f