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

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