aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYongqin Liu <yongqin.liu@linaro.org>2018-04-11 00:40:02 +0800
committerYongqin Liu <yongqin.liu@linaro.org>2018-04-11 00:41:20 +0800
commitaa4c730bf9e2aab2e532b7356dd0c70a31c90887 (patch)
tree0f66627e4323e3ff6605feb851ff477f37476426
parent97c386159c44a851d323f36ef6078c5a8f0d4c13 (diff)
downloadlibc-bench-aa4c730bf9e2aab2e532b7356dd0c70a31c90887.tar.gz
Fix compiling warnings reported by P Preview build
Change-Id: Ib1b57eb0a89c3b66f0ab2a2770a1fd23bf989165 Signed-off-by: Yongqin Liu <yongqin.liu@linaro.org>
-rw-r--r--.gitreview5
-rw-r--r--Android.mk1
-rw-r--r--malloc.c18
-rw-r--r--pthread.c4
-rw-r--r--regex.c1
-rw-r--r--stdio.c8
-rw-r--r--string.c8
7 files changed, 24 insertions, 21 deletions
diff --git a/.gitreview b/.gitreview
new file mode 100644
index 0000000..009aa47
--- /dev/null
+++ b/.gitreview
@@ -0,0 +1,5 @@
+[gerrit]
+host=android-review.linaro.org
+port=29418
+project=platform/external/libc-bench
+defaultbranch=master
diff --git a/Android.mk b/Android.mk
index 1dc1a0b..6c82dea 100644
--- a/Android.mk
+++ b/Android.mk
@@ -17,6 +17,7 @@ LOCAL_MODULE_STEM_32 := $(LOCAL_MODULE)
LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE)64
LOCAL_MODULE_TAGS := debug
+LOCAL_CFLAGS += "-D__unused=__attribute__((unused))"
LOCAL_CFLAGS += -std=gnu99 -D_XOPEN_SOURCE=700
diff --git a/malloc.c b/malloc.c
index 79cc88b..17a9203 100644
--- a/malloc.c
+++ b/malloc.c
@@ -3,7 +3,7 @@
#include <string.h>
#include <pthread.h>
-size_t b_malloc_sparse(void *dummy)
+size_t b_malloc_sparse(void *dummy __unused)
{
void *p[10000];
size_t i;
@@ -16,7 +16,7 @@ size_t b_malloc_sparse(void *dummy)
return 0;
}
-size_t b_malloc_bubble(void *dummy)
+size_t b_malloc_bubble(void *dummy __unused)
{
void *p[10000];
size_t i;
@@ -29,7 +29,7 @@ size_t b_malloc_bubble(void *dummy)
return 0;
}
-size_t b_malloc_tiny1(void *dummy)
+size_t b_malloc_tiny1(void *dummy __unused)
{
void *p[10000];
size_t i;
@@ -42,7 +42,7 @@ size_t b_malloc_tiny1(void *dummy)
return 0;
}
-size_t b_malloc_tiny2(void *dummy)
+size_t b_malloc_tiny2(void *dummy __unused)
{
void *p[10000];
size_t i;
@@ -54,7 +54,7 @@ size_t b_malloc_tiny2(void *dummy)
return 0;
}
-size_t b_malloc_big1(void *dummy)
+size_t b_malloc_big1(void *dummy __unused)
{
void *p[2000];
size_t i;
@@ -67,7 +67,7 @@ size_t b_malloc_big1(void *dummy)
return 0;
}
-size_t b_malloc_big2(void *dummy)
+size_t b_malloc_big2(void *dummy __unused)
{
void *p[2000];
size_t i;
@@ -124,12 +124,11 @@ static void *stress(void *arg)
return 0;
}
-size_t b_malloc_thread_stress(void *dummy)
+size_t b_malloc_thread_stress(void *dummy __unused)
{
struct foo foo[SH_COUNT] = {0};
pthread_t td1, td2;
void *res;
- int i;
pthread_create(&td1, 0, stress, foo);
pthread_create(&td2, 0, stress, foo);
@@ -138,13 +137,12 @@ size_t b_malloc_thread_stress(void *dummy)
return 0;
}
-size_t b_malloc_thread_local(void *dummy)
+size_t b_malloc_thread_local(void *dummy __unused)
{
struct foo foo1[SH_COUNT] = {0};
struct foo foo2[SH_COUNT] = {0};
pthread_t td1, td2;
void *res;
- int i;
pthread_create(&td1, 0, stress, foo1);
pthread_create(&td2, 0, stress, foo2);
diff --git a/pthread.c b/pthread.c
index 33ab9ec..dda3646 100644
--- a/pthread.c
+++ b/pthread.c
@@ -4,7 +4,7 @@
#include <pthread.h>
#include <unistd.h>
-void *emptyfunc(void *dummy)
+void *emptyfunc(void *dummy __unused)
{
return 0;
}
@@ -33,7 +33,7 @@ size_t b_pthread_createjoin_serial2(void *dummy)
return 0;
}
-size_t b_pthread_create_serial1(void *dummy)
+size_t b_pthread_create_serial1(void *dummy __unused)
{
size_t i;
pthread_attr_t attr;
diff --git a/regex.c b/regex.c
index dfb60f1..871b82e 100644
--- a/regex.c
+++ b/regex.c
@@ -19,7 +19,6 @@ void b_regex_search(void *s)
{
char buf[260000];
regex_t re;
- size_t i;
setlocale(LC_CTYPE, "");
memset(buf, 'a', sizeof(buf)-2);
buf[sizeof buf - 2] = 'b';
diff --git a/stdio.c b/stdio.c
index 0d41f86..8f81e07 100644
--- a/stdio.c
+++ b/stdio.c
@@ -2,11 +2,11 @@
#include <stdlib.h>
#include <string.h>
-size_t b_stdio_putcgetc(void *dummy)
+size_t b_stdio_putcgetc(void *dummy __unused)
{
FILE *f = tmpfile();
size_t i;
- size_t cs;
+ size_t cs = 0;
for (i=0; i<5000000; i++)
putc('x', f);
@@ -18,11 +18,11 @@ size_t b_stdio_putcgetc(void *dummy)
return cs;
}
-size_t b_stdio_putcgetc_unlocked(void *dummy)
+size_t b_stdio_putcgetc_unlocked(void *dummy __unused)
{
FILE *f = tmpfile();
size_t i;
- size_t cs;
+ size_t cs = 0;
for (i=0; i<5000000; i++)
putc_unlocked('x', f);
diff --git a/string.c b/string.c
index b7582a0..515a87e 100644
--- a/string.c
+++ b/string.c
@@ -25,7 +25,7 @@ long b_string_strstr(void *dummy)
return cs;
}
-size_t b_string_memset(void *dummy)
+size_t b_string_memset(void *dummy __unused)
{
char *buf = malloc(BUFLEN);
size_t i;
@@ -35,11 +35,11 @@ size_t b_string_memset(void *dummy)
return 0;
}
-long b_string_strchr(void *dummy)
+long b_string_strchr(void *dummy __unused)
{
char *buf = malloc(BUFLEN);
size_t i;
- long cs;
+ long cs = 0;
memset(buf, 'a', BUFLEN);
buf[BUFLEN-1] = 0;
buf[BUFLEN-2] = 'b';
@@ -51,7 +51,7 @@ long b_string_strchr(void *dummy)
return cs;
}
-size_t b_string_strlen(void *dummy)
+size_t b_string_strlen(void *dummy __unused)
{
char *buf = malloc(BUFLEN);
size_t i;