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

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