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