summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorEric Blake <ebb9@byu.net>2009-10-29 09:15:06 -0600
committerEric Blake <ebb9@byu.net>2009-10-29 18:39:29 -0600
commitb886ebac9e37729d68e765b141b099ec5b24ab2c (patch)
tree8d2aae3381ea14f9870611bfd82704e2ff327ae9 /tests
parentc65dda0e17504e0ae5b259a2d2b28b0529016b86 (diff)
downloadgnulib-b886ebac9e37729d68e765b141b099ec5b24ab2c.tar.gz
tests: avoid some compiler warnings
Mostly Simon's modules; warnings reported by gcc 4.3.4 on coreutils. * tests/test-getaddrinfo.c (simple): Mark static, and allow string literals. * tests/test-memchr.c (main): Avoid type mismatch. * tests/test-arpa_inet.c (main): Avoid unused parameters. * tests/test-base64.c (main): Likewise. * tests/test-getdelim.c (main): Likewise. * tests/test-gethostname.c (main): Likewise. * tests/test-getline.c (main): Likewise. * tests/test-netinet_in.c (main): Likewise. * tests/test-select.c (open_server_socket, main): Likewise. * tests/test-select-stdin.c (main): Likewise. * tests/test-sockets.c (main): Likewise. * tests/test-strsignal.c (main): Likewise. * tests/test-sys_select.c (main): Likewise. * tests/test-sys_socket.c (main): Likewise. * tests/test-u64.c (main): Likewise. * tests/test-xfprintf-posix.c (main): Likewise. * tests/test-xvasprintf.c (test_xvasprintf, main): Likewise. Signed-off-by: Eric Blake <ebb9@byu.net>
Diffstat (limited to 'tests')
-rw-r--r--tests/test-arpa_inet.c4
-rw-r--r--tests/test-base64.c4
-rw-r--r--tests/test-getaddrinfo.c3
-rw-r--r--tests/test-getdelim.c4
-rw-r--r--tests/test-gethostname.c2
-rw-r--r--tests/test-getline.c4
-rw-r--r--tests/test-memchr.c2
-rw-r--r--tests/test-netinet_in.c4
-rw-r--r--tests/test-select-stdin.c4
-rw-r--r--tests/test-select.c4
-rw-r--r--tests/test-sockets.c2
-rw-r--r--tests/test-strsignal.c4
-rw-r--r--tests/test-sys_select.c2
-rw-r--r--tests/test-sys_socket.c2
-rw-r--r--tests/test-u64.c2
-rw-r--r--tests/test-xfprintf-posix.c4
-rw-r--r--tests/test-xvasprintf.c6
17 files changed, 29 insertions, 28 deletions
diff --git a/tests/test-arpa_inet.c b/tests/test-arpa_inet.c
index fc2d8ba448..1e2479f4f9 100644
--- a/tests/test-arpa_inet.c
+++ b/tests/test-arpa_inet.c
@@ -1,5 +1,5 @@
/* Test of <arpa/inet.h> substitute.
- Copyright (C) 2007 Free Software Foundation, Inc.
+ Copyright (C) 2007, 2009 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -21,7 +21,7 @@
#include <arpa/inet.h>
int
-main ()
+main (void)
{
return 0;
}
diff --git a/tests/test-base64.c b/tests/test-base64.c
index f707a9e6b1..7440e8cd1b 100644
--- a/tests/test-base64.c
+++ b/tests/test-base64.c
@@ -1,5 +1,5 @@
/* Self tests for base64.
- Copyright (C) 2004, 2008 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2008, 2009 Free Software Foundation, Inc.
Written by Simon Josefsson.
This program is free software: you can redistribute it and/or modify
@@ -25,7 +25,7 @@
#include "base64.h"
int
-main (int argc, char *argv[])
+main (void)
{
const char *in = "abcdefghijklmnop";
const char *b64in = "YWJjZGVmZw==";
diff --git a/tests/test-getaddrinfo.c b/tests/test-getaddrinfo.c
index eeea3f7c43..384b98b6e8 100644
--- a/tests/test-getaddrinfo.c
+++ b/tests/test-getaddrinfo.c
@@ -44,7 +44,8 @@
# define EAI_SERVICE 0
#endif
-int simple (char *host, char *service)
+static int
+simple (char const *host, char const *service)
{
char buf[BUFSIZ];
static int skip = 0;
diff --git a/tests/test-getdelim.c b/tests/test-getdelim.c
index 0c112f6bd5..da4fe6b313 100644
--- a/tests/test-getdelim.c
+++ b/tests/test-getdelim.c
@@ -1,5 +1,5 @@
/* Test of getdelim() function.
- Copyright (C) 2007-2008 Free Software Foundation, Inc.
+ Copyright (C) 2007-2009 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -36,7 +36,7 @@
while (0)
int
-main (int argc, char **argv)
+main (void)
{
FILE *f;
char *line = NULL;
diff --git a/tests/test-gethostname.c b/tests/test-gethostname.c
index 3ab0b86af5..32723da193 100644
--- a/tests/test-gethostname.c
+++ b/tests/test-gethostname.c
@@ -29,7 +29,7 @@
#define NOHOSTNAME "magic-gnulib-test-string"
int
-main (int argc, char *argv[])
+main (int argc, char *argv[] _UNUSED_PARAMETER_)
{
char buf[HOST_NAME_MAX];
int rc;
diff --git a/tests/test-getline.c b/tests/test-getline.c
index 51fc816866..50722cd48d 100644
--- a/tests/test-getline.c
+++ b/tests/test-getline.c
@@ -1,5 +1,5 @@
/* Test of getline() function.
- Copyright (C) 2007-2008 Free Software Foundation, Inc.
+ Copyright (C) 2007-2009 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -36,7 +36,7 @@
while (0)
int
-main (int argc, char **argv)
+main (void)
{
FILE *f;
char *line = NULL;
diff --git a/tests/test-memchr.c b/tests/test-memchr.c
index a8cfc9b222..d5e53e0081 100644
--- a/tests/test-memchr.c
+++ b/tests/test-memchr.c
@@ -109,7 +109,7 @@ main (void)
ASSERT (MEMCHR (mem, 'U', n) == NULL);
{
- int i;
+ size_t i;
for (i = 0; i < n; i++)
{
diff --git a/tests/test-netinet_in.c b/tests/test-netinet_in.c
index b1957197b7..5a61557c94 100644
--- a/tests/test-netinet_in.c
+++ b/tests/test-netinet_in.c
@@ -1,5 +1,5 @@
/* Test of <netinet/in.h> substitute.
- Copyright (C) 2007 Free Software Foundation, Inc.
+ Copyright (C) 2007, 2009 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -21,7 +21,7 @@
#include <netinet/in.h>
int
-main ()
+main (void)
{
return 0;
}
diff --git a/tests/test-select-stdin.c b/tests/test-select-stdin.c
index e855f92d20..079dec50e7 100644
--- a/tests/test-select-stdin.c
+++ b/tests/test-select-stdin.c
@@ -1,5 +1,5 @@
/* Test of select() substitute, reading from stdin.
- Copyright (C) 2008 Free Software Foundation, Inc.
+ Copyright (C) 2008, 2009 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -25,7 +25,7 @@
#include <unistd.h>
int
-main ()
+main (void)
{
printf ("Applying select() from standard input. Press Ctrl-C to abort.\n");
for (;;)
diff --git a/tests/test-select.c b/tests/test-select.c
index ec82250149..d6d6b063ac 100644
--- a/tests/test-select.c
+++ b/tests/test-select.c
@@ -84,7 +84,7 @@ test (void (*fn) (void), const char *msg)
/* Funny socket code. */
static int
-open_server_socket ()
+open_server_socket (void)
{
int s, x;
struct sockaddr_in ia;
@@ -355,7 +355,7 @@ test_pipe (void)
/* Do them all. */
int
-main ()
+main (void)
{
int result;
diff --git a/tests/test-sockets.c b/tests/test-sockets.c
index 3c85a431c5..2d259649cd 100644
--- a/tests/test-sockets.c
+++ b/tests/test-sockets.c
@@ -22,7 +22,7 @@
#include "sockets.h"
int
-main (int argc, char *argv[])
+main (void)
{
int err;
diff --git a/tests/test-strsignal.c b/tests/test-strsignal.c
index 8868346e6f..a4be4b7a76 100644
--- a/tests/test-strsignal.c
+++ b/tests/test-strsignal.c
@@ -1,5 +1,5 @@
/* Test of strsignal() function.
- Copyright (C) 2008 Free Software Foundation, Inc.
+ Copyright (C) 2008, 2009 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -44,7 +44,7 @@
#endif
int
-main (int argc, char **argv)
+main (void)
{
/* Work around bug in cygwin 1.5.25 <string.h> by declaring str as
const char *, even though strsignal is supposed to return char *.
diff --git a/tests/test-sys_select.c b/tests/test-sys_select.c
index 66079529ef..aef8941071 100644
--- a/tests/test-sys_select.c
+++ b/tests/test-sys_select.c
@@ -24,7 +24,7 @@
struct timeval t1;
int
-main ()
+main (void)
{
/* Check that FD_ZERO can be used. This should not yield a warning
such as "warning: implicit declaration of function 'memset'". */
diff --git a/tests/test-sys_socket.c b/tests/test-sys_socket.c
index 3d946a83bf..ddb491b312 100644
--- a/tests/test-sys_socket.c
+++ b/tests/test-sys_socket.c
@@ -28,7 +28,7 @@ int a[] = { SHUT_RD, SHUT_WR, SHUT_RDWR };
#endif
int
-main ()
+main (void)
{
struct sockaddr_storage x;
sa_family_t i;
diff --git a/tests/test-u64.c b/tests/test-u64.c
index 85e72478a3..aa0b5d1a32 100644
--- a/tests/test-u64.c
+++ b/tests/test-u64.c
@@ -21,7 +21,7 @@
#include <u64.h>
int
-main ()
+main (void)
{
u64 i = u64init (42, 4711);
u64 j, k, l;
diff --git a/tests/test-xfprintf-posix.c b/tests/test-xfprintf-posix.c
index adfa1fd055..b001f04267 100644
--- a/tests/test-xfprintf-posix.c
+++ b/tests/test-xfprintf-posix.c
@@ -1,5 +1,5 @@
/* Test of error-checking xfprintf() function with POSIX compatible formatting.
- Copyright (C) 2007-2008 Free Software Foundation, Inc.
+ Copyright (C) 2007-2009 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -44,7 +44,7 @@
#include "test-fprintf-posix.h"
int
-main (int argc, char *argv[])
+main (int argc _UNUSED_PARAMETER_, char *argv[])
{
set_program_name (argv[0]);
diff --git a/tests/test-xvasprintf.c b/tests/test-xvasprintf.c
index 234ec8373f..37603142f9 100644
--- a/tests/test-xvasprintf.c
+++ b/tests/test-xvasprintf.c
@@ -1,5 +1,5 @@
/* Test of xvasprintf() and xasprintf() functions.
- Copyright (C) 2007-2008 Free Software Foundation, Inc.
+ Copyright (C) 2007-2009 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -52,7 +52,7 @@ my_xasprintf (const char *format, ...)
}
static void
-test_xvasprintf ()
+test_xvasprintf (void)
{
int repeat;
@@ -80,7 +80,7 @@ test_xasprintf ()
}
int
-main (int argc, char *argv[])
+main (int argc _UNUSED_PARAMETER_, char *argv[])
{
set_program_name (argv[0]);