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

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