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

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