clean up compiler warnings
authornsz <nsz@port70.net>
Tue, 27 Mar 2012 12:03:56 +0000 (14:03 +0200)
committernsz <nsz@port70.net>
Tue, 27 Mar 2012 12:03:56 +0000 (14:03 +0200)
Makefile.inc
src/math/lrint.c
src/process/spawn.c
src/stdio/snprintf.c
src/stdio/swprintf.c
src/thread/pthread.c

index f0ebc00..69de079 100644 (file)
@@ -9,7 +9,7 @@ OBJS = $(SRCS:.c=.o)
 AR=ar
 RANLIB=ranlib
 
-CFLAGS += -g -D_POSIX_C_SOURCE=200809L -std=c99 -pipe -Wall -Wno-unused-function
+CFLAGS += -g -D_POSIX_C_SOURCE=200809L -std=c99 -pipe -Wall -Wno-unused-function -Wno-missing-braces
 LDFLAGS += -g -lpthread -lrt -lm
 
 -include $(TROOT)/config.mak
index 22328d1..6f03c6b 100644 (file)
@@ -226,7 +226,7 @@ FE_TOWARDZERO, -0x1.ffffffffp+31,           0, FE_INVALID,
 
 void test_lrint()
 {
-       int f, i, j;
+       int f, i;
        long n;
 
        for (i = 0; i < sizeof t/sizeof *t; i++) {
index 18b8e27..bc1dc12 100644 (file)
@@ -21,7 +21,6 @@ void test_spawn(void) {
        int p[2];
        pid_t pid;
        int status;
-       posix_spawnattr_t attr;
        posix_spawn_file_actions_t fa;
 
        TEST_E(!pipe(p));
index f8768a8..ce92c1a 100644 (file)
@@ -119,7 +119,7 @@ static const struct {
 void test_snprintf(void)
 {
        int i, j, k;
-       char b[2000], *s;
+       char b[2000];
 
        TEST(i, snprintf(0, 0, "%d", 123456), 6, "length returned %d != %d");
        TEST(i, snprintf(0, 0, "%.4s", "hello"), 4, "length returned %d != %d");
index f05b150..14c53d6 100644 (file)
@@ -96,7 +96,7 @@ static const struct {
 
 void test_swprintf(void) {
        int i, j;
-       wchar_t b[500], *s;
+       wchar_t b[500];
 
        setlocale(LC_CTYPE, "en_US.UTF-8") ||
        setlocale(LC_CTYPE, "en_GB.UTF-8") ||
index 3cc6b84..bb2f253 100644 (file)
@@ -141,9 +141,7 @@ void test_pthread(void)
        int foo[4], bar[2];
        pthread_barrier_t barrier2;
        pthread_mutexattr_t mtx_a;
-       pthread_mutex_t *sh_mtx;
        sem_t sem1;
-       int fd;
        pthread_mutex_t mtx;
        pthread_cond_t cond;