diff options
author | H. Peter Anvin <hpa@zytor.com> | 2002-08-13 17:51:30 +0000 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2002-08-13 17:51:30 +0000 |
commit | ff1b5f868918563dd89dca9e3682494d1e7bff8a (patch) | |
tree | 76dd86a4b8103fa2efa7fb46129bf47ab0529bfd | |
parent | d91fd498a9342d1f97f1259052e2844aceb7b8b5 (diff) | |
download | klibc-ff1b5f868918563dd89dca9e3682494d1e7bff8a.tar.gz |
More warnings cleanups, some of which were actually real...klibc-0.31
-rw-r--r-- | getdomainname.c | 2 | ||||
-rw-r--r-- | gethostname.c | 2 | ||||
-rw-r--r-- | getopt.c | 3 | ||||
-rw-r--r-- | include/stdio.h | 2 | ||||
-rw-r--r-- | klibc/MCONFIG | 2 | ||||
-rw-r--r-- | klibc/getdomainname.c | 2 | ||||
-rw-r--r-- | klibc/gethostname.c | 2 | ||||
-rw-r--r-- | klibc/getopt.c | 3 | ||||
-rw-r--r-- | klibc/include/stdio.h | 2 | ||||
-rw-r--r-- | klibc/tests/malloctest.c | 2 | ||||
-rw-r--r-- | klibc/tests/nfs_no_rpc.c | 7 | ||||
-rw-r--r-- | klibc/tests/testrand48.c | 2 | ||||
-rw-r--r-- | klibc/tests/testvsnp.c | 2 | ||||
-rw-r--r-- | tests/malloctest.c | 2 | ||||
-rw-r--r-- | tests/nfs_no_rpc.c | 7 | ||||
-rw-r--r-- | tests/testrand48.c | 2 | ||||
-rw-r--r-- | tests/testvsnp.c | 2 |
17 files changed, 35 insertions, 11 deletions
diff --git a/getdomainname.c b/getdomainname.c index 4c7deff6e48b0..4cd68a3cb5c44 100644 --- a/getdomainname.c +++ b/getdomainname.c @@ -19,5 +19,7 @@ int getdomainname(char *name, size_t len) return -1; } + strcpy(name, un.domainname); + return 0; } diff --git a/gethostname.c b/gethostname.c index 938d277fe7c96..6c5062e81669f 100644 --- a/gethostname.c +++ b/gethostname.c @@ -19,5 +19,7 @@ int gethostname(char *name, size_t len) return -1; } + strcpy(name, un.nodename); + return 0; } diff --git a/getopt.c b/getopt.c index bccd30199771c..5a992dcdd7370 100644 --- a/getopt.c +++ b/getopt.c @@ -19,6 +19,9 @@ int getopt(int argc, char * const *argv, const char *optstring) const char *osptr; int opt; + /* We don't actually need argc */ + (void)argc; + /* First, eliminate all non-option cases */ if ( !carg || carg[0] != '-' || !carg[1] ) { diff --git a/include/stdio.h b/include/stdio.h index d6f0c1d588be2..a413df3f54a5c 100644 --- a/include/stdio.h +++ b/include/stdio.h @@ -46,7 +46,7 @@ __extern FILE *fopen(const char *, const char *); static __inline__ FILE *fdopen(int __fd, const char *__m) { - return __create_file(__fd); + (void)__m; return __create_file(__fd); } static __inline__ int fclose(FILE *__f) { diff --git a/klibc/MCONFIG b/klibc/MCONFIG index af3971ebd8547..781e54708b90d 100644 --- a/klibc/MCONFIG +++ b/klibc/MCONFIG @@ -10,7 +10,7 @@ LD = $(CROSS)ld REQFLAGS = -nostdinc -iwithprefix include -I. \ -I./arch/$(ARCH)/include -I./include/bits$(BITSIZE) \ -DBITSIZE=$(BITSIZE) -I./include -I./linux/include \ - -Wall -Wpointer-arith -Wwrite-strings -Wstrict-prototypes -Winline + -W -Wall -Wpointer-arith -Wwrite-strings -Wstrict-prototypes -Winline CFLAGS = $(OPTFLAGS) $(REQFLAGS) LDFLAGS = AR = $(CROSS)ar diff --git a/klibc/getdomainname.c b/klibc/getdomainname.c index 4c7deff6e48b0..4cd68a3cb5c44 100644 --- a/klibc/getdomainname.c +++ b/klibc/getdomainname.c @@ -19,5 +19,7 @@ int getdomainname(char *name, size_t len) return -1; } + strcpy(name, un.domainname); + return 0; } diff --git a/klibc/gethostname.c b/klibc/gethostname.c index 938d277fe7c96..6c5062e81669f 100644 --- a/klibc/gethostname.c +++ b/klibc/gethostname.c @@ -19,5 +19,7 @@ int gethostname(char *name, size_t len) return -1; } + strcpy(name, un.nodename); + return 0; } diff --git a/klibc/getopt.c b/klibc/getopt.c index bccd30199771c..5a992dcdd7370 100644 --- a/klibc/getopt.c +++ b/klibc/getopt.c @@ -19,6 +19,9 @@ int getopt(int argc, char * const *argv, const char *optstring) const char *osptr; int opt; + /* We don't actually need argc */ + (void)argc; + /* First, eliminate all non-option cases */ if ( !carg || carg[0] != '-' || !carg[1] ) { diff --git a/klibc/include/stdio.h b/klibc/include/stdio.h index d6f0c1d588be2..a413df3f54a5c 100644 --- a/klibc/include/stdio.h +++ b/klibc/include/stdio.h @@ -46,7 +46,7 @@ __extern FILE *fopen(const char *, const char *); static __inline__ FILE *fdopen(int __fd, const char *__m) { - return __create_file(__fd); + (void)__m; return __create_file(__fd); } static __inline__ int fclose(FILE *__f) { diff --git a/klibc/tests/malloctest.c b/klibc/tests/malloctest.c index ad2292c2741cd..64e8e79851a87 100644 --- a/klibc/tests/malloctest.c +++ b/klibc/tests/malloctest.c @@ -4105,7 +4105,7 @@ int sizes[NCYCLES] = { char *pointers[NCYCLES]; -int main(int argc, char *argv[]) +int main(void) { int r, i, j, sp, sq; char *p, *q, *ep, *eq; diff --git a/klibc/tests/nfs_no_rpc.c b/klibc/tests/nfs_no_rpc.c index 8ae2a7e1d93d0..11b9f61fea5f4 100644 --- a/klibc/tests/nfs_no_rpc.c +++ b/klibc/tests/nfs_no_rpc.c @@ -1,11 +1,13 @@ #include <sys/types.h> #include <sys/socket.h> #include <sys/utsname.h> +#include <sys/mount.h> #include <netinet/in.h> #include <unistd.h> #include <signal.h> #include <string.h> #include <stdlib.h> +#include <stdio.h> /* Default path we try to mount. "%s" gets replaced by our IP address */ #define NFS_ROOT "/tftpboot/%s" @@ -268,6 +270,7 @@ static u_int32_t XID; static int flag; static void timeout(int n) { + (void)n; flag = 1; } static int do_call(struct sockaddr_in *sin, u_int32_t msg[], u_int32_t rmsg[], @@ -472,12 +475,14 @@ static int root_nfs_ports(void) return 0; } -int main(int argc, char *argv[]) +int main(void) { unsigned char *p; struct timeval tv; char *s; + /* FIX: use getopt() instead of this */ + s = getenv("root_server_addr"); if (s) root_server_addr = strtoul(s, NULL, 10); diff --git a/klibc/tests/testrand48.c b/klibc/tests/testrand48.c index 8eb2b3b3ec8fb..bf046b6bda179 100644 --- a/klibc/tests/testrand48.c +++ b/klibc/tests/testrand48.c @@ -1,7 +1,7 @@ #include <stdlib.h> #include <stdio.h> -int main(int argc, char *argv[]) +int main(void) { unsigned short seed1[] = { 0x1234, 0x5678, 0x9abc }; unsigned short *oldseed; diff --git a/klibc/tests/testvsnp.c b/klibc/tests/testvsnp.c index 8af3774017f6c..c86e8b30fb4b0 100644 --- a/klibc/tests/testvsnp.c +++ b/klibc/tests/testvsnp.c @@ -5,7 +5,7 @@ #include <string.h> #include <stdio.h> -int main(int argc, char *argv[]) +int main(void) { int r, i; char buffer[512]; diff --git a/tests/malloctest.c b/tests/malloctest.c index ad2292c2741cd..64e8e79851a87 100644 --- a/tests/malloctest.c +++ b/tests/malloctest.c @@ -4105,7 +4105,7 @@ int sizes[NCYCLES] = { char *pointers[NCYCLES]; -int main(int argc, char *argv[]) +int main(void) { int r, i, j, sp, sq; char *p, *q, *ep, *eq; diff --git a/tests/nfs_no_rpc.c b/tests/nfs_no_rpc.c index 8ae2a7e1d93d0..11b9f61fea5f4 100644 --- a/tests/nfs_no_rpc.c +++ b/tests/nfs_no_rpc.c @@ -1,11 +1,13 @@ #include <sys/types.h> #include <sys/socket.h> #include <sys/utsname.h> +#include <sys/mount.h> #include <netinet/in.h> #include <unistd.h> #include <signal.h> #include <string.h> #include <stdlib.h> +#include <stdio.h> /* Default path we try to mount. "%s" gets replaced by our IP address */ #define NFS_ROOT "/tftpboot/%s" @@ -268,6 +270,7 @@ static u_int32_t XID; static int flag; static void timeout(int n) { + (void)n; flag = 1; } static int do_call(struct sockaddr_in *sin, u_int32_t msg[], u_int32_t rmsg[], @@ -472,12 +475,14 @@ static int root_nfs_ports(void) return 0; } -int main(int argc, char *argv[]) +int main(void) { unsigned char *p; struct timeval tv; char *s; + /* FIX: use getopt() instead of this */ + s = getenv("root_server_addr"); if (s) root_server_addr = strtoul(s, NULL, 10); diff --git a/tests/testrand48.c b/tests/testrand48.c index 8eb2b3b3ec8fb..bf046b6bda179 100644 --- a/tests/testrand48.c +++ b/tests/testrand48.c @@ -1,7 +1,7 @@ #include <stdlib.h> #include <stdio.h> -int main(int argc, char *argv[]) +int main(void) { unsigned short seed1[] = { 0x1234, 0x5678, 0x9abc }; unsigned short *oldseed; diff --git a/tests/testvsnp.c b/tests/testvsnp.c index 8af3774017f6c..c86e8b30fb4b0 100644 --- a/tests/testvsnp.c +++ b/tests/testvsnp.c @@ -5,7 +5,7 @@ #include <string.h> #include <stdio.h> -int main(int argc, char *argv[]) +int main(void) { int r, i; char buffer[512]; |