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