bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

avoid some warnings in tests


From: Eric Blake
Subject: avoid some warnings in tests
Date: Thu, 22 Oct 2009 21:16:50 -0600
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.23) Gecko/20090812 Thunderbird/2.0.0.23 Mnenhy/0.7.6.666

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

In coreutils, I turned on gcc warnings for the gnulib unit tests.  This
cleans up the modules that are mainly from Jim and myself, and mostly hits
places that used 'main ()' or did 'char *foo = "str"'.  Simon and Bruno
had the most other tests that used 'main ()'; C89 says you should use
'main (void)' or 'main (int, char**)', but I did not clean those up
without first getting some feedback to give me the okay.

- --
Don't work too hard, make some time for fun as well!

Eric Blake             address@hidden
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkrhICEACgkQ84KuGfSFAYB5PQCfVhC66E8VyI0ixyk87ozRMqvK
rQQAoLou0400GsoDFOydUljd+mw1ralW
=jBQU
-----END PGP SIGNATURE-----
>From 82381b9e5b37125305709d412d8322b35e5c4796 Mon Sep 17 00:00:00 2001
From: Eric Blake <address@hidden>
Date: Thu, 22 Oct 2009 07:59:46 -0600
Subject: [PATCH] tests: avoid several compiler warnings

* tests/test-getcwd.c (main): Avoid buffer underflow.
* tests/test-getdate.c (main): String literals are not safe with
putenv, so use setenv.  Declare unused argument.
* modules/getdate-tests (Depends-on): Add setenv.
* tests/test-argv-iter.c (main): Declare unused argument.  Avoid
problems with string literals in char *.
* tests/test-hash.c (main): Avoid shadowing declaration.
(insert_new): Treat string literals as char const *.
* tests/test-getopt.h (test_getopt): Likewise.
(getopt_loop): Alter types to minimize casting elsewhere.
* tests/test-getopt_long.h (test_getopt_long, getopt_long_loop)
(test_getopt_long_posix): Likewise.
(do_getopt_long): Add wrapper to minimize casting.
* tests/test-atexit.c (clear_temp_file): Use void.
* tests/test-areadlink-with-size.c (main): Declare unused
arguments.
* tests/test-areadlink.c (main): Likewise.
* tests/test-areadlinkat-with-size.c (main): Likewise.
* tests/test-areadlinkat.c (main): Likewise.
* tests/test-canonicalize-lgpl.c (main): Likewise.
* tests/test-canonicalize.c (main): Likewise.
* tests/test-dirent-safer.c (main): Likewise.
* tests/test-dirname.c (main): Likewise.
* tests/test-dup2.c (main): Likewise.
* tests/test-fchdir.c (main): Likewise.
* tests/test-fcntl-h.c (main): Likewise.
* tests/test-fcntl-safer.c (main): Likewise.
* tests/test-fdopendir.c (main): Likewise.
* tests/test-fdutimensat.c (main): Likewise.
* tests/test-fflush.c (main): Likewise.
* tests/test-filenamecat.c (main): Likewise.
* tests/test-filevercmp.c (main): Likewise.
* tests/test-fopen-safer.c (main): Likewise.
* tests/test-fopen.c (main): Likewise.
* tests/test-fpending.c (main): Likewise.
* tests/test-fpurge.c (main): Likewise.
* tests/test-freading.c (main): Likewise.
* tests/test-fstatat.c (main): Likewise.
* tests/test-fsync.c (main): Likewise.
* tests/test-futimens.c (main): Likewise.
* tests/test-getndelim2.c (main): Likewise.
* tests/test-gettimeofday.c (main): Likewise.
* tests/test-getopt.c (main): Likewise.
* tests/test-i-ring.c (main): Likewise.
* tests/test-inttypes.c (main): Likewise.
* tests/test-link.c (main): Likewise.
* tests/test-lstat.c (main): Likewise.
* tests/test-math.c (main): Likewise.
* tests/test-md5.c (main): Likewise.
* tests/test-memchr2.c (main): Likewise.
* tests/test-memrchr.c (main): Likewise.
* tests/test-mkdir.c (main): Likewise.
* tests/test-mkdirat.c (main): Likewise.
* tests/test-mkfifoat.c (main): Likewise.
* tests/test-open.c (main): Likewise.
* tests/test-openat-safer.c (main): Likewise.
* tests/test-openat.c (main): Likewise.
* tests/test-quotearg.c (main): Likewise.
* tests/test-rawmemchr.c (main): Likewise.
* tests/test-readlink.c (main): Likewise.
* tests/test-remove.c (main): Likewise.
* tests/test-rename.c (main): Likewise.
* tests/test-renameat.c (main): Likewise.
* tests/test-rmdir.c (main): Likewise.
* tests/test-sha1.c (main): Likewise.
* tests/test-signal.c (main): Likewise.
* tests/test-sigaction.c (main): Likewise.
* tests/test-stat.c (main): Likewise.
* tests/test-stat-time.c (main): Likewise.
* tests/test-stddef.c (main): Likewise.
* tests/test-stdint.c (main): Likewise.
* tests/test-stdio.c (main): Likewise.
* tests/test-stdlib.c (main): Likewise.
* tests/test-strchrnul.c (main): Likewise.
* tests/test-strerror.c (main): Likewise.
* tests/test-string.c (main): Likewise.
* tests/test-strtod.c (main): Likewise.
* tests/test-strverscmp.c (main): Likewise.
* tests/test-symlink.c (main): Likewise.
* tests/test-symlinkat.c (main): Likewise.
* tests/test-sys_stat.c (main): Likewise.
* tests/test-sys_time.c (main): Likewise.
* tests/test-time.c (main): Likewise.
* tests/test-unistd.c (main): Likewise.
* tests/test-unlink.c (main): Likewise.
* tests/test-unlinkat.c (main): Likewise.
* tests/test-utimens.c (main): Likewise.
* tests/test-utimensat.c (main): Likewise.
* tests/test-version-etc.c (main): Likewise.
* tests/test-wchar.c (main): Likewise.
* tests/test-wctype.c (main): Likewise.
* tests/test-xprintf-posix.c (main): Likewise.
* tests/test-posixtm.c (main): Likewise.
(STREQ): Delete unused macro.
* tests/test-linkat.c (main): Declare unused arguments.  Avoid
shadowed variables.
* tests/test-memchr.c (main): Likewise.

Signed-off-by: Eric Blake <address@hidden>
---
 ChangeLog                          |  101 ++++++++++++++++++++++++++++++++++++
 modules/getdate-tests              |    1 +
 tests/test-areadlink-with-size.c   |    2 +-
 tests/test-areadlink.c             |    2 +-
 tests/test-areadlinkat-with-size.c |    2 +-
 tests/test-areadlinkat.c           |    2 +-
 tests/test-argv-iter.c             |   11 +++--
 tests/test-atexit.c                |    2 +-
 tests/test-canonicalize-lgpl.c     |    2 +-
 tests/test-canonicalize.c          |    2 +-
 tests/test-dirent-safer.c          |    2 +-
 tests/test-dirname.c               |    4 +-
 tests/test-dup2.c                  |    2 +-
 tests/test-fchdir.c                |    2 +-
 tests/test-fcntl-h.c               |    2 +-
 tests/test-fcntl-safer.c           |    2 +-
 tests/test-fdopendir.c             |    2 +-
 tests/test-fdutimensat.c           |    2 +-
 tests/test-fflush.c                |    4 +-
 tests/test-filenamecat.c           |    2 +-
 tests/test-filevercmp.c            |    2 +-
 tests/test-fopen-safer.c           |    2 +-
 tests/test-fopen.c                 |    2 +-
 tests/test-fpending.c              |    4 +-
 tests/test-fpurge.c                |    2 +-
 tests/test-freading.c              |    4 +-
 tests/test-fstatat.c               |    2 +-
 tests/test-fsync.c                 |    4 +-
 tests/test-futimens.c              |    2 +-
 tests/test-getcwd.c                |    2 +-
 tests/test-getdate.c               |    4 +-
 tests/test-getndelim2.c            |    4 +-
 tests/test-getopt.c                |    2 +-
 tests/test-getopt.h                |   44 ++++++++--------
 tests/test-getopt_long.h           |   97 +++++++++++++++++++---------------
 tests/test-gettimeofday.c          |    4 +-
 tests/test-hash.c                  |    8 ++--
 tests/test-i-ring.c                |    4 +-
 tests/test-inttypes.c              |    4 +-
 tests/test-link.c                  |    2 +-
 tests/test-linkat.c                |    4 +-
 tests/test-lstat.c                 |    2 +-
 tests/test-math.c                  |    4 +-
 tests/test-md5.c                   |    4 +-
 tests/test-memchr.c                |    4 +-
 tests/test-memchr2.c               |    2 +-
 tests/test-memrchr.c               |    2 +-
 tests/test-mkdir.c                 |    2 +-
 tests/test-mkdirat.c               |    2 +-
 tests/test-mkfifoat.c              |    2 +-
 tests/test-open.c                  |    2 +-
 tests/test-openat-safer.c          |    2 +-
 tests/test-openat.c                |    2 +-
 tests/test-posixtm.c               |    4 +-
 tests/test-quotearg.c              |    2 +-
 tests/test-rawmemchr.c             |    4 +-
 tests/test-readlink.c              |    2 +-
 tests/test-remove.c                |    2 +-
 tests/test-rename.c                |    2 +-
 tests/test-renameat.c              |    2 +-
 tests/test-rmdir.c                 |    2 +-
 tests/test-sha1.c                  |    2 +-
 tests/test-sigaction.c             |    4 +-
 tests/test-signal.c                |    3 +-
 tests/test-stat-time.c             |    2 +-
 tests/test-stat.c                  |    2 +-
 tests/test-stddef.c                |    2 +-
 tests/test-stdint.c                |    4 +-
 tests/test-stdio.c                 |    2 +-
 tests/test-stdlib.c                |    2 +-
 tests/test-strchrnul.c             |    4 +-
 tests/test-strerror.c              |    4 +-
 tests/test-string.c                |    2 +-
 tests/test-strtod.c                |    4 +-
 tests/test-strverscmp.c            |    4 +-
 tests/test-symlink.c               |    2 +-
 tests/test-symlinkat.c             |    2 +-
 tests/test-sys_stat.c              |    2 +-
 tests/test-sys_time.c              |    4 +-
 tests/test-time.c                  |    2 +-
 tests/test-unistd.c                |    2 +-
 tests/test-unlink.c                |    2 +-
 tests/test-unlinkat.c              |    2 +-
 tests/test-utimens.c               |    2 +-
 tests/test-utimensat.c             |    2 +-
 tests/test-version-etc.c           |    2 +-
 tests/test-wchar.c                 |    2 +-
 tests/test-wctype.c                |    2 +-
 tests/test-xprintf-posix.c         |    4 +-
 89 files changed, 295 insertions(+), 182 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index c08b844..03519a6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,104 @@
+2009-10-22  Eric Blake  <address@hidden>
+
+       tests: avoid several compiler warnings
+       * tests/test-getcwd.c (main): Avoid buffer underflow.
+       * tests/test-getdate.c (main): String literals are not safe with
+       putenv, so use setenv.  Declare unused argument.
+       * modules/getdate-tests (Depends-on): Add setenv.
+       * tests/test-argv-iter.c (main): Declare unused argument.  Avoid
+       problems with string literals in char *.
+       * tests/test-hash.c (main): Avoid shadowing declaration.
+       (insert_new): Treat string literals as char const *.
+       * tests/test-getopt.h (test_getopt): Likewise.
+       (getopt_loop): Alter types to minimize casting elsewhere.
+       * tests/test-getopt_long.h (test_getopt_long, getopt_long_loop)
+       (test_getopt_long_posix): Likewise.
+       (do_getopt_long): Add wrapper to minimize casting.
+       * tests/test-atexit.c (clear_temp_file): Use void.
+       * tests/test-areadlink-with-size.c (main): Declare unused
+       arguments.
+       * tests/test-areadlink.c (main): Likewise.
+       * tests/test-areadlinkat-with-size.c (main): Likewise.
+       * tests/test-areadlinkat.c (main): Likewise.
+       * tests/test-canonicalize-lgpl.c (main): Likewise.
+       * tests/test-canonicalize.c (main): Likewise.
+       * tests/test-dirent-safer.c (main): Likewise.
+       * tests/test-dirname.c (main): Likewise.
+       * tests/test-dup2.c (main): Likewise.
+       * tests/test-fchdir.c (main): Likewise.
+       * tests/test-fcntl-h.c (main): Likewise.
+       * tests/test-fcntl-safer.c (main): Likewise.
+       * tests/test-fdopendir.c (main): Likewise.
+       * tests/test-fdutimensat.c (main): Likewise.
+       * tests/test-fflush.c (main): Likewise.
+       * tests/test-filenamecat.c (main): Likewise.
+       * tests/test-filevercmp.c (main): Likewise.
+       * tests/test-fopen-safer.c (main): Likewise.
+       * tests/test-fopen.c (main): Likewise.
+       * tests/test-fpending.c (main): Likewise.
+       * tests/test-fpurge.c (main): Likewise.
+       * tests/test-freading.c (main): Likewise.
+       * tests/test-fstatat.c (main): Likewise.
+       * tests/test-fsync.c (main): Likewise.
+       * tests/test-futimens.c (main): Likewise.
+       * tests/test-getndelim2.c (main): Likewise.
+       * tests/test-gettimeofday.c (main): Likewise.
+       * tests/test-getopt.c (main): Likewise.
+       * tests/test-i-ring.c (main): Likewise.
+       * tests/test-inttypes.c (main): Likewise.
+       * tests/test-link.c (main): Likewise.
+       * tests/test-lstat.c (main): Likewise.
+       * tests/test-math.c (main): Likewise.
+       * tests/test-md5.c (main): Likewise.
+       * tests/test-memchr2.c (main): Likewise.
+       * tests/test-memrchr.c (main): Likewise.
+       * tests/test-mkdir.c (main): Likewise.
+       * tests/test-mkdirat.c (main): Likewise.
+       * tests/test-mkfifoat.c (main): Likewise.
+       * tests/test-open.c (main): Likewise.
+       * tests/test-openat-safer.c (main): Likewise.
+       * tests/test-openat.c (main): Likewise.
+       * tests/test-quotearg.c (main): Likewise.
+       * tests/test-rawmemchr.c (main): Likewise.
+       * tests/test-readlink.c (main): Likewise.
+       * tests/test-remove.c (main): Likewise.
+       * tests/test-rename.c (main): Likewise.
+       * tests/test-renameat.c (main): Likewise.
+       * tests/test-rmdir.c (main): Likewise.
+       * tests/test-sha1.c (main): Likewise.
+       * tests/test-signal.c (main): Likewise.
+       * tests/test-sigaction.c (main): Likewise.
+       * tests/test-stat.c (main): Likewise.
+       * tests/test-stat-time.c (main): Likewise.
+       * tests/test-stddef.c (main): Likewise.
+       * tests/test-stdint.c (main): Likewise.
+       * tests/test-stdio.c (main): Likewise.
+       * tests/test-stdlib.c (main): Likewise.
+       * tests/test-strchrnul.c (main): Likewise.
+       * tests/test-strerror.c (main): Likewise.
+       * tests/test-string.c (main): Likewise.
+       * tests/test-strtod.c (main): Likewise.
+       * tests/test-strverscmp.c (main): Likewise.
+       * tests/test-symlink.c (main): Likewise.
+       * tests/test-symlinkat.c (main): Likewise.
+       * tests/test-sys_stat.c (main): Likewise.
+       * tests/test-sys_time.c (main): Likewise.
+       * tests/test-time.c (main): Likewise.
+       * tests/test-unistd.c (main): Likewise.
+       * tests/test-unlink.c (main): Likewise.
+       * tests/test-unlinkat.c (main): Likewise.
+       * tests/test-utimens.c (main): Likewise.
+       * tests/test-utimensat.c (main): Likewise.
+       * tests/test-version-etc.c (main): Likewise.
+       * tests/test-wchar.c (main): Likewise.
+       * tests/test-wctype.c (main): Likewise.
+       * tests/test-xprintf-posix.c (main): Likewise.
+       * tests/test-posixtm.c (main): Likewise.
+       (STREQ): Delete unused macro.
+       * tests/test-linkat.c (main): Declare unused arguments.  Avoid
+       shadowed variables.
+       * tests/test-memchr.c (main): Likewise.
+
 2009-10-21  Eric Blake  <address@hidden>

        areadlinkat: avoid failure on older glibc
diff --git a/modules/getdate-tests b/modules/getdate-tests
index afacd09..6b7c92b 100644
--- a/modules/getdate-tests
+++ b/modules/getdate-tests
@@ -3,6 +3,7 @@ tests/test-getdate.c

 Depends-on:
 progname
+setenv

 configure.ac:

diff --git a/tests/test-areadlink-with-size.c b/tests/test-areadlink-with-size.c
index 2a175a5..ff50f89 100644
--- a/tests/test-areadlink-with-size.c
+++ b/tests/test-areadlink-with-size.c
@@ -46,7 +46,7 @@
 #include "test-areadlink.h"

 int
-main ()
+main (void)
 {
   /* Remove any leftovers from a previous partial run.  */
   ASSERT (system ("rm -rf " BASE "*") == 0);
diff --git a/tests/test-areadlink.c b/tests/test-areadlink.c
index 657ea6f..aa297ce 100644
--- a/tests/test-areadlink.c
+++ b/tests/test-areadlink.c
@@ -53,7 +53,7 @@ do_areadlink (char const *name, size_t ignored 
_UNUSED_PARAMETER_)
 }

 int
-main ()
+main (void)
 {
   /* Remove any leftovers from a previous partial run.  */
   ASSERT (system ("rm -rf " BASE "*") == 0);
diff --git a/tests/test-areadlinkat-with-size.c 
b/tests/test-areadlinkat-with-size.c
index df4afc2..55ab78e 100644
--- a/tests/test-areadlinkat-with-size.c
+++ b/tests/test-areadlinkat-with-size.c
@@ -55,7 +55,7 @@ do_areadlinkat_with_size (char const *name, size_t size)
 }

 int
-main ()
+main (void)
 {
   int result;

diff --git a/tests/test-areadlinkat.c b/tests/test-areadlinkat.c
index 5f8d4b0..e567b37 100644
--- a/tests/test-areadlinkat.c
+++ b/tests/test-areadlinkat.c
@@ -55,7 +55,7 @@ do_areadlinkat (char const *name, size_t ignored 
_UNUSED_PARAMETER_)
 }

 int
-main ()
+main (void)
 {
   int result;

diff --git a/tests/test-argv-iter.c b/tests/test-argv-iter.c
index 5070754..eef3014 100644
--- a/tests/test-argv-iter.c
+++ b/tests/test-argv-iter.c
@@ -54,14 +54,17 @@ write_nul_delimited_argv (char **argv)
 }

 int
-main ()
+main (void)
 {
   /* set_program_name (argv[0]); placate overzealous "syntax-check" test.  */
+  static char one[] = "1";
+  static char two[] = "2";
+  static char three[] = "3";
   static char *av[][4] = {
     {NULL},
-    {"1", NULL},
-    {"1", "2", NULL},
-    {"1", "2", "3", NULL}
+    {one, NULL},
+    {one, two, NULL},
+    {one, two, three, NULL}
   };

   int use_stream;
diff --git a/tests/test-atexit.c b/tests/test-atexit.c
index 883b056..97afff5 100644
--- a/tests/test-atexit.c
+++ b/tests/test-atexit.c
@@ -24,7 +24,7 @@
 #define TEMPFILE "t-atexit.tmp"

 static void
-clear_temp_file ()
+clear_temp_file (void)
 {
   unlink (TEMPFILE);
 }
diff --git a/tests/test-canonicalize-lgpl.c b/tests/test-canonicalize-lgpl.c
index cb09790..ef6bd9d 100644
--- a/tests/test-canonicalize-lgpl.c
+++ b/tests/test-canonicalize-lgpl.c
@@ -44,7 +44,7 @@
 #define BASE "t-can-lgpl.tmp"

 int
-main ()
+main (void)
 {
 #ifdef GNULIB_CANONICALIZE
   /* No need to test canonicalize-lgpl module if canonicalize is also
diff --git a/tests/test-canonicalize.c b/tests/test-canonicalize.c
index 7de6059..eeae9e0 100644
--- a/tests/test-canonicalize.c
+++ b/tests/test-canonicalize.c
@@ -45,7 +45,7 @@
 #define BASE "t-can.tmp"

 int
-main ()
+main (void)
 {
   /* Setup some hierarchy to be used by this test.  Start by removing
      any leftovers from a previous partial run.  */
diff --git a/tests/test-dirent-safer.c b/tests/test-dirent-safer.c
index aeb8342..8d5d529 100644
--- a/tests/test-dirent-safer.c
+++ b/tests/test-dirent-safer.c
@@ -48,7 +48,7 @@ static FILE *myerr;
   while (0)

 int
-main ()
+main (void)
 {
   int i;
   DIR *dp;
diff --git a/tests/test-dirname.c b/tests/test-dirname.c
index 44898dd..bd75020 100644
--- a/tests/test-dirname.c
+++ b/tests/test-dirname.c
@@ -1,5 +1,5 @@
 /* Test the gnulib dirname module.
-   Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc.
+   Copyright (C) 2005, 2006, 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
@@ -131,7 +131,7 @@ static struct test tests[] = {
 };

 int
-main ()
+main (void)
 {
   struct test *t;
   bool ok = true;
diff --git a/tests/test-dup2.c b/tests/test-dup2.c
index e1ffc21..32c354d 100644
--- a/tests/test-dup2.c
+++ b/tests/test-dup2.c
@@ -61,7 +61,7 @@ is_open (int fd)
 }

 int
-main ()
+main (void)
 {
   const char *file = "test-dup2.tmp";
   char buffer[1];
diff --git a/tests/test-fchdir.c b/tests/test-fchdir.c
index b361d0d..53d6631 100644
--- a/tests/test-fchdir.c
+++ b/tests/test-fchdir.c
@@ -39,7 +39,7 @@
   while (0)

 int
-main ()
+main (void)
 {
   char *cwd = getcwd (NULL, 0);
   int fd = open (".", O_RDONLY);
diff --git a/tests/test-fcntl-h.c b/tests/test-fcntl-h.c
index 649c44a..a1f0866 100644
--- a/tests/test-fcntl-h.c
+++ b/tests/test-fcntl-h.c
@@ -32,7 +32,7 @@ int sk[] = { SEEK_CUR, SEEK_END, SEEK_SET };
 int fd = FD_CLOEXEC;

 int
-main ()
+main (void)
 {
   return 0;
 }
diff --git a/tests/test-fcntl-safer.c b/tests/test-fcntl-safer.c
index 433160b..33c7c2c 100644
--- a/tests/test-fcntl-safer.c
+++ b/tests/test-fcntl-safer.c
@@ -25,7 +25,7 @@
 #include "test-open.h"

 int
-main ()
+main (void)
 {
   return test_open ();
 }
diff --git a/tests/test-fdopendir.c b/tests/test-fdopendir.c
index 330544c..fad60cf 100644
--- a/tests/test-fdopendir.c
+++ b/tests/test-fdopendir.c
@@ -39,7 +39,7 @@
   while (0)

 int
-main ()
+main (void)
 {
   DIR *d;
   int fd;
diff --git a/tests/test-fdutimensat.c b/tests/test-fdutimensat.c
index b5c60ae..00729d8 100644
--- a/tests/test-fdutimensat.c
+++ b/tests/test-fdutimensat.c
@@ -86,7 +86,7 @@ do_utimens (const char *name, struct timespec const times[2])
 }

 int
-main ()
+main (void)
 {
   int result1; /* Skip because of no symlink support.  */
   int result2; /* Skip because of no futimens support.  */
diff --git a/tests/test-fflush.c b/tests/test-fflush.c
index 6f369f0..3a17f8d 100644
--- a/tests/test-fflush.c
+++ b/tests/test-fflush.c
@@ -1,5 +1,5 @@
 /* Test of POSIX compatible fflush() function.
-   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
@@ -22,7 +22,7 @@
 #include <unistd.h>

 int
-main (int argc, char *argv[])
+main (void)
 {
   FILE *f;
   char buffer[10];
diff --git a/tests/test-filenamecat.c b/tests/test-filenamecat.c
index d102ef6..44a7bd5 100644
--- a/tests/test-filenamecat.c
+++ b/tests/test-filenamecat.c
@@ -29,7 +29,7 @@
 #include "progname.h"

 int
-main (int argc, char *argv[])
+main (int argc _UNUSED_PARAMETER_, char *argv[])
 {
   static char const *const tests[][3] =
     {
diff --git a/tests/test-filevercmp.c b/tests/test-filevercmp.c
index ca88eb3..14426a6 100644
--- a/tests/test-filevercmp.c
+++ b/tests/test-filevercmp.c
@@ -97,7 +97,7 @@ static const char *const examples[] =
 };

 int
-main (int argc, char **argv)
+main (void)
 {
   const char *const *i;

diff --git a/tests/test-fopen-safer.c b/tests/test-fopen-safer.c
index e613364..088489a 100644
--- a/tests/test-fopen-safer.c
+++ b/tests/test-fopen-safer.c
@@ -25,7 +25,7 @@
 #include "test-fopen.h"

 int
-main ()
+main (void)
 {
   return test_fopen ();
 }
diff --git a/tests/test-fopen.c b/tests/test-fopen.c
index 6efd480..29d7839 100644
--- a/tests/test-fopen.c
+++ b/tests/test-fopen.c
@@ -25,7 +25,7 @@
 #include "test-fopen.h"

 int
-main ()
+main (void)
 {
   return test_fopen ();
 }
diff --git a/tests/test-fpending.c b/tests/test-fpending.c
index 8d9e5ae..6c053dc 100644
--- a/tests/test-fpending.c
+++ b/tests/test-fpending.c
@@ -1,6 +1,6 @@
 /* Ensure that __fpending works.

-   Copyright (C) 2004, 2007-2008 Free Software Foundation, Inc.
+   Copyright (C) 2004, 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
@@ -37,7 +37,7 @@
   while (0)

 int
-main ()
+main (void)
 {
   ASSERT (__fpending (stdout) == 0);

diff --git a/tests/test-fpurge.c b/tests/test-fpurge.c
index 13388ec..319a040 100644
--- a/tests/test-fpurge.c
+++ b/tests/test-fpurge.c
@@ -38,7 +38,7 @@
 #define TESTFILE "t-fpurge.tmp"

 int
-main ()
+main (void)
 {
   int check_filepos;

diff --git a/tests/test-freading.c b/tests/test-freading.c
index c4d5533..0f8e686 100644
--- a/tests/test-freading.c
+++ b/tests/test-freading.c
@@ -1,5 +1,5 @@
 /* Test of freading() 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
@@ -38,7 +38,7 @@
 #define TESTFILE "t-freading.tmp"

 int
-main ()
+main (void)
 {
   FILE *fp;

diff --git a/tests/test-fstatat.c b/tests/test-fstatat.c
index 2c65262..ad5434e 100644
--- a/tests/test-fstatat.c
+++ b/tests/test-fstatat.c
@@ -65,7 +65,7 @@ do_lstat (char const *name, struct stat *st)
 }

 int
-main ()
+main (void)
 {
   int result;
   ASSERT (test_stat_func (do_stat) == 0);
diff --git a/tests/test-fsync.c b/tests/test-fsync.c
index b6ffe2a..c00d54f 100644
--- a/tests/test-fsync.c
+++ b/tests/test-fsync.c
@@ -1,5 +1,5 @@
 /* Test of fsync() 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
@@ -34,7 +34,7 @@
   while (0)

 int
-main ()
+main (void)
 {
   int fd;
   const char *file = "test-fsync.txt";
diff --git a/tests/test-futimens.c b/tests/test-futimens.c
index 3eac64c..4e049bd 100644
--- a/tests/test-futimens.c
+++ b/tests/test-futimens.c
@@ -49,7 +49,7 @@
 #include "test-futimens.h"

 int
-main ()
+main (void)
 {
   /* Clean up any trash from prior testsuite runs.  */
   ASSERT (system ("rm -rf " BASE "*") == 0);
diff --git a/tests/test-getcwd.c b/tests/test-getcwd.c
index 2733e4f..9a4ba4b 100644
--- a/tests/test-getcwd.c
+++ b/tests/test-getcwd.c
@@ -62,7 +62,7 @@ main (int argc, char **argv)
   free (pwd2);
   {
     size_t len = strlen (pwd1);
-    size_t i = len - 10;
+    ssize_t i = len - 10;
     if (i < 0)
       i = 0;
     pwd2 = malloc (len + 2);
diff --git a/tests/test-getdate.c b/tests/test-getdate.c
index ea70527..5866886 100644
--- a/tests/test-getdate.c
+++ b/tests/test-getdate.c
@@ -61,7 +61,7 @@ static const char* const day_table[] =
 };

 int
-main (int argc, char **argv)
+main (int argc _UNUSED_PARAMETER_, char **argv)
 {
   struct timespec result;
   struct timespec result2;
@@ -225,7 +225,7 @@ main (int argc, char **argv)
          && result.tv_nsec == result2.tv_nsec);

   /* Check that some "next Monday", "last Wednesday", etc. are correct.  */
-  putenv ("TZ=UTC0");
+  setenv ("TZ", "UTC0", 1);
   for (i = 0; day_table[i]; i++)
     {
       unsigned int thur2 = 7 * 24 * 3600; /* 2nd thursday */
diff --git a/tests/test-getndelim2.c b/tests/test-getndelim2.c
index d1eb12a..84135ea 100644
--- a/tests/test-getndelim2.c
+++ b/tests/test-getndelim2.c
@@ -1,5 +1,5 @@
 /* Test of getndelim2() 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
@@ -38,7 +38,7 @@
   while (0)

 int
-main (int argc, char **argv)
+main (void)
 {
   FILE *f;
   char *line = NULL;
diff --git a/tests/test-getopt.c b/tests/test-getopt.c
index 12d8d92..6c59d47 100644
--- a/tests/test-getopt.c
+++ b/tests/test-getopt.c
@@ -53,7 +53,7 @@
 #endif

 int
-main ()
+main (void)
 {
   unsetenv ("POSIXLY_CORRECT");

diff --git a/tests/test-getopt.h b/tests/test-getopt.h
index 352fe32..4efec4b 100644
--- a/tests/test-getopt.h
+++ b/tests/test-getopt.h
@@ -17,7 +17,7 @@
 /* Written by Bruno Haible <address@hidden>, 2009.  */

 static void
-getopt_loop (int argc, char **argv,
+getopt_loop (int argc, const char **argv,
             const char *options,
             int *a_seen, int *b_seen,
             const char **p_value, const char **q_value,
@@ -27,7 +27,7 @@ getopt_loop (int argc, char **argv,
   int c;

   opterr = 0;
-  while ((c = getopt (argc, argv, options)) != -1)
+  while ((c = getopt (argc, (char **) argv, options)) != -1)
     {
       switch (c)
        {
@@ -74,7 +74,7 @@ test_getopt (void)
       const char *non_options[10];
       int unrecognized = 0;
       int argc = 0;
-      char *argv[10];
+      const char *argv[10];

       argv[argc++] = "program";
       argv[argc++] = "-a";
@@ -102,7 +102,7 @@ test_getopt (void)
       const char *non_options[10];
       int unrecognized = 0;
       int argc = 0;
-      char *argv[10];
+      const char *argv[10];

       argv[argc++] = "program";
       argv[argc++] = "-b";
@@ -131,7 +131,7 @@ test_getopt (void)
       const char *non_options[10];
       int unrecognized = 0;
       int argc = 0;
-      char *argv[10];
+      const char *argv[10];

       argv[argc++] = "program";
       argv[argc++] = "-ba";
@@ -159,7 +159,7 @@ test_getopt (void)
       const char *non_options[10];
       int unrecognized = 0;
       int argc = 0;
-      char *argv[10];
+      const char *argv[10];

       argv[argc++] = "program";
       argv[argc++] = "-ab";
@@ -190,7 +190,7 @@ test_getopt (void)
       const char *non_options[10];
       int unrecognized = 0;
       int argc = 0;
-      char *argv[10];
+      const char *argv[10];

       argv[argc++] = "program";
       argv[argc++] = "-pfoo";
@@ -217,7 +217,7 @@ test_getopt (void)
       const char *non_options[10];
       int unrecognized = 0;
       int argc = 0;
-      char *argv[10];
+      const char *argv[10];

       argv[argc++] = "program";
       argv[argc++] = "-p";
@@ -245,7 +245,7 @@ test_getopt (void)
       const char *non_options[10];
       int unrecognized = 0;
       int argc = 0;
-      char *argv[10];
+      const char *argv[10];

       argv[argc++] = "program";
       argv[argc++] = "-ab";
@@ -278,7 +278,7 @@ test_getopt (void)
       const char *non_options[10];
       int unrecognized = 0;
       int argc = 0;
-      char *argv[10];
+      const char *argv[10];

       argv[argc++] = "program";
       argv[argc++] = "-pfoo";
@@ -305,7 +305,7 @@ test_getopt (void)
       const char *non_options[10];
       int unrecognized = 0;
       int argc = 0;
-      char *argv[10];
+      const char *argv[10];

       argv[argc++] = "program";
       argv[argc++] = "-p";
@@ -333,7 +333,7 @@ test_getopt (void)
       const char *non_options[10];
       int unrecognized = 0;
       int argc = 0;
-      char *argv[10];
+      const char *argv[10];

       argv[argc++] = "program";
       argv[argc++] = "-p";
@@ -364,7 +364,7 @@ test_getopt (void)
       const char *non_options[10];
       int unrecognized = 0;
       int argc = 0;
-      char *argv[10];
+      const char *argv[10];

       argv[argc++] = "program";
       argv[argc++] = "-p";
@@ -396,7 +396,7 @@ test_getopt (void)
       const char *non_options[10];
       int unrecognized = 0;
       int argc = 0;
-      char *argv[10];
+      const char *argv[10];

       argv[argc++] = "program";
       argv[argc++] = "donald";
@@ -458,7 +458,7 @@ test_getopt (void)
       const char *non_options[10];
       int unrecognized = 0;
       int argc = 0;
-      char *argv[20];
+      const char *argv[20];

       argv[argc++] = "program";
       argv[argc++] = "donald";
@@ -536,7 +536,7 @@ test_getopt (void)
       const char *non_options[10];
       int unrecognized = 0;
       int argc = 0;
-      char *argv[10];
+      const char *argv[10];

       argv[argc++] = "program";
       argv[argc++] = "donald";
@@ -579,7 +579,7 @@ test_getopt (void)
       const char *non_options[10];
       int unrecognized = 0;
       int argc = 0;
-      char *argv[20];
+      const char *argv[20];

       argv[argc++] = "program";
       argv[argc++] = "donald";
@@ -650,7 +650,7 @@ test_getopt (void)
       const char *non_options[10];
       int unrecognized = 0;
       int argc = 0;
-      char *argv[10];
+      const char *argv[10];

       argv[argc++] = "program";
       argv[argc++] = "donald";
@@ -713,7 +713,7 @@ test_getopt (void)
       const char *non_options[10];
       int unrecognized = 0;
       int argc = 0;
-      char *argv[10];
+      const char *argv[10];

       argv[argc++] = "program";
       argv[argc++] = "donald";
@@ -751,7 +751,7 @@ test_getopt (void)
       const char *non_options[10];
       int unrecognized = 0;
       int argc = 0;
-      char *argv[10];
+      const char *argv[10];

       argv[argc++] = "program";
       argv[argc++] = "-+";
@@ -779,7 +779,7 @@ test_getopt (void)
       const char *non_options[10];
       int unrecognized = 0;
       int argc = 0;
-      char *argv[20];
+      const char *argv[20];

       argv[argc++] = "program";
       argv[argc++] = "donald";
@@ -829,7 +829,7 @@ test_getopt (void)
       const char *non_options[10];
       int unrecognized = 0;
       int argc = 0;
-      char *argv[10];
+      const char *argv[10];

       argv[argc++] = "program";
       argv[argc++] = "donald";
diff --git a/tests/test-getopt_long.h b/tests/test-getopt_long.h
index fb505b2..d0d16fa 100644
--- a/tests/test-getopt_long.h
+++ b/tests/test-getopt_long.h
@@ -41,7 +41,7 @@ static const struct option long_options_optional[] =
   };

 static void
-getopt_long_loop (int argc, char **argv,
+getopt_long_loop (int argc, const char **argv,
                  const char *options, const struct option *long_options,
                  const char **p_value, const char **q_value,
                  int *non_options_count, const char **non_options,
@@ -51,7 +51,8 @@ getopt_long_loop (int argc, char **argv,
   int c;

   opterr = 0;
-  while ((c = getopt_long (argc, argv, options, long_options, &option_index))
+  while ((c = getopt_long (argc, (char **) argv, options, long_options,
+                          &option_index))
         != -1)
     {
       switch (c)
@@ -86,6 +87,16 @@ getopt_long_loop (int argc, char **argv,
     }
 }

+/* Reduce casting, so we can use string literals elsewhere.
+   getopt_long takes an array of char*, but luckily does not modify
+   those elements, so we can pass const char*.  */
+static int
+do_getopt_long (int argc, const char **argv, const char *shortopts,
+                const struct option *longopts, int *longind)
+{
+  return getopt_long (argc, (char **) argv, shortopts, longopts, longind);
+}
+
 static void
 test_getopt_long (void)
 {
@@ -94,7 +105,7 @@ test_getopt_long (void)
   /* Test disambiguation of options.  */
   {
     int argc = 0;
-    char *argv[10];
+    const char *argv[10];
     int option_index;
     int c;

@@ -102,13 +113,13 @@ test_getopt_long (void)
     argv[argc++] = "--x";
     optind = 1;
     opterr = 0;
-    c = getopt_long (argc, argv, "ab", long_options_required, &option_index);
+    c = do_getopt_long (argc, argv, "ab", long_options_required, 
&option_index);
     ASSERT (c == '?');
     ASSERT (optopt == 0);
   }
   {
     int argc = 0;
-    char *argv[10];
+    const char *argv[10];
     int option_index;
     int c;

@@ -116,13 +127,13 @@ test_getopt_long (void)
     argv[argc++] = "--xt";
     optind = 1;
     opterr = 0;
-    c = getopt_long (argc, argv, "ab", long_options_required, &option_index);
+    c = do_getopt_long (argc, argv, "ab", long_options_required, 
&option_index);
     ASSERT (c == '?');
     ASSERT (optopt == 0);
   }
   {
     int argc = 0;
-    char *argv[10];
+    const char *argv[10];
     int option_index;
     int c;

@@ -130,13 +141,13 @@ test_getopt_long (void)
     argv[argc++] = "--xtr";
     optind = 1;
     opterr = 0;
-    c = getopt_long (argc, argv, "ab", long_options_required, &option_index);
+    c = do_getopt_long (argc, argv, "ab", long_options_required, 
&option_index);
     ASSERT (c == '?');
     ASSERT (optopt == 0);
   }
   {
     int argc = 0;
-    char *argv[10];
+    const char *argv[10];
     int option_index;
     int c;

@@ -144,12 +155,12 @@ test_getopt_long (void)
     argv[argc++] = "--xtra";
     optind = 1;
     opterr = 0;
-    c = getopt_long (argc, argv, "ab", long_options_required, &option_index);
+    c = do_getopt_long (argc, argv, "ab", long_options_required, 
&option_index);
     ASSERT (c == 1001);
   }
   {
     int argc = 0;
-    char *argv[10];
+    const char *argv[10];
     int option_index;
     int c;

@@ -157,13 +168,13 @@ test_getopt_long (void)
     argv[argc++] = "--xtre";
     optind = 1;
     opterr = 0;
-    c = getopt_long (argc, argv, "ab", long_options_required, &option_index);
+    c = do_getopt_long (argc, argv, "ab", long_options_required, 
&option_index);
     ASSERT (c == '?');
     ASSERT (optopt == 0);
   }
   {
     int argc = 0;
-    char *argv[10];
+    const char *argv[10];
     int option_index;
     int c;

@@ -171,13 +182,13 @@ test_getopt_long (void)
     argv[argc++] = "--xtrem";
     optind = 1;
     opterr = 0;
-    c = getopt_long (argc, argv, "ab", long_options_required, &option_index);
+    c = do_getopt_long (argc, argv, "ab", long_options_required, 
&option_index);
     ASSERT (c == '?');
     ASSERT (optopt == 0);
   }
   {
     int argc = 0;
-    char *argv[10];
+    const char *argv[10];
     int option_index;
     int c;

@@ -185,12 +196,12 @@ test_getopt_long (void)
     argv[argc++] = "--xtreme";
     optind = 1;
     opterr = 0;
-    c = getopt_long (argc, argv, "ab", long_options_required, &option_index);
+    c = do_getopt_long (argc, argv, "ab", long_options_required, 
&option_index);
     ASSERT (c == 1002);
   }
   {
     int argc = 0;
-    char *argv[10];
+    const char *argv[10];
     int option_index;
     int c;

@@ -198,12 +209,12 @@ test_getopt_long (void)
     argv[argc++] = "--xtremel";
     optind = 1;
     opterr = 0;
-    c = getopt_long (argc, argv, "ab", long_options_required, &option_index);
+    c = do_getopt_long (argc, argv, "ab", long_options_required, 
&option_index);
     ASSERT (c == 1003);
   }
   {
     int argc = 0;
-    char *argv[10];
+    const char *argv[10];
     int option_index;
     int c;

@@ -211,7 +222,7 @@ test_getopt_long (void)
     argv[argc++] = "--xtremely";
     optind = 1;
     opterr = 0;
-    c = getopt_long (argc, argv, "ab", long_options_required, &option_index);
+    c = do_getopt_long (argc, argv, "ab", long_options_required, 
&option_index);
     ASSERT (c == 1003);
   }

@@ -224,7 +235,7 @@ test_getopt_long (void)
       const char *non_options[10];
       int unrecognized = 0;
       int argc = 0;
-      char *argv[10];
+      const char *argv[10];
       a_seen = 0;
       b_seen = 0;

@@ -252,7 +263,7 @@ test_getopt_long (void)
       const char *non_options[10];
       int unrecognized = 0;
       int argc = 0;
-      char *argv[10];
+      const char *argv[10];
       a_seen = 0;
       b_seen = 0;

@@ -281,7 +292,7 @@ test_getopt_long (void)
       const char *non_options[10];
       int unrecognized = 0;
       int argc = 0;
-      char *argv[10];
+      const char *argv[10];
       a_seen = 0;
       b_seen = 0;

@@ -309,7 +320,7 @@ test_getopt_long (void)
       const char *non_options[10];
       int unrecognized = 0;
       int argc = 0;
-      char *argv[10];
+      const char *argv[10];
       a_seen = 0;
       b_seen = 0;

@@ -340,7 +351,7 @@ test_getopt_long (void)
       const char *non_options[10];
       int unrecognized = 0;
       int argc = 0;
-      char *argv[10];
+      const char *argv[10];
       a_seen = 0;
       b_seen = 0;

@@ -367,7 +378,7 @@ test_getopt_long (void)
       const char *non_options[10];
       int unrecognized = 0;
       int argc = 0;
-      char *argv[10];
+      const char *argv[10];
       a_seen = 0;
       b_seen = 0;

@@ -395,7 +406,7 @@ test_getopt_long (void)
       const char *non_options[10];
       int unrecognized = 0;
       int argc = 0;
-      char *argv[10];
+      const char *argv[10];
       a_seen = 0;
       b_seen = 0;

@@ -427,7 +438,7 @@ test_getopt_long (void)
       const char *non_options[10];
       int unrecognized = 0;
       int argc = 0;
-      char *argv[10];
+      const char *argv[10];
       a_seen = 0;
       b_seen = 0;

@@ -454,7 +465,7 @@ test_getopt_long (void)
       const char *non_options[10];
       int unrecognized = 0;
       int argc = 0;
-      char *argv[10];
+      const char *argv[10];
       a_seen = 0;
       b_seen = 0;

@@ -482,7 +493,7 @@ test_getopt_long (void)
       const char *non_options[10];
       int unrecognized = 0;
       int argc = 0;
-      char *argv[10];
+      const char *argv[10];
       a_seen = 0;
       b_seen = 0;

@@ -512,7 +523,7 @@ test_getopt_long (void)
       const char *non_options[10];
       int unrecognized = 0;
       int argc = 0;
-      char *argv[10];
+      const char *argv[10];
       a_seen = 0;
       b_seen = 0;

@@ -544,7 +555,7 @@ test_getopt_long (void)
       const char *non_options[10];
       int unrecognized = 0;
       int argc = 0;
-      char *argv[10];
+      const char *argv[10];
       a_seen = 0;
       b_seen = 0;

@@ -584,7 +595,7 @@ test_getopt_long (void)
       const char *non_options[10];
       int unrecognized = 0;
       int argc = 0;
-      char *argv[20];
+      const char *argv[20];
       a_seen = 0;
       b_seen = 0;

@@ -634,7 +645,7 @@ test_getopt_long (void)
       const char *non_options[10];
       int unrecognized = 0;
       int argc = 0;
-      char *argv[10];
+      const char *argv[10];
       a_seen = 0;
       b_seen = 0;

@@ -677,7 +688,7 @@ test_getopt_long (void)
       const char *non_options[10];
       int unrecognized = 0;
       int argc = 0;
-      char *argv[20];
+      const char *argv[20];
       a_seen = 0;
       b_seen = 0;

@@ -747,7 +758,7 @@ test_getopt_long (void)
       const char *non_options[10];
       int unrecognized = 0;
       int argc = 0;
-      char *argv[10];
+      const char *argv[10];
       a_seen = 0;
       b_seen = 0;

@@ -788,7 +799,7 @@ test_getopt_long (void)
       const char *non_options[10];
       int unrecognized = 0;
       int argc = 0;
-      char *argv[10];
+      const char *argv[10];
       a_seen = 0;
       b_seen = 0;

@@ -826,7 +837,7 @@ test_getopt_long (void)
       const char *non_options[10];
       int unrecognized = 0;
       int argc = 0;
-      char *argv[10];
+      const char *argv[10];
       a_seen = 0;
       b_seen = 0;

@@ -854,7 +865,7 @@ test_getopt_long (void)
       const char *non_options[10];
       int unrecognized = 0;
       int argc = 0;
-      char *argv[20];
+      const char *argv[20];
       a_seen = 0;
       b_seen = 0;

@@ -904,7 +915,7 @@ test_getopt_long (void)
       const char *non_options[10];
       int unrecognized = 0;
       int argc = 0;
-      char *argv[10];
+      const char *argv[10];
       a_seen = 0;
       b_seen = 0;

@@ -944,14 +955,14 @@ static void
 test_getopt_long_posix (void)
 {
   int c = 3;
-  char *v[4] = {"test", "-r", "foo", NULL};
-  struct option l[] = {{NULL}};
+  const char *v[4] = {"test", "-r", "foo", NULL};
+  struct option l[] = {{NULL, 0, NULL, 0}};
   int start;
   int result;
   for (start = OPTIND_MIN; start <= 1; start++)
     {
       optind = start;
-      result = getopt_long (c, v, "r::", l, NULL);
+      result = do_getopt_long (c, v, "r::", l, NULL);
     }
   ASSERT (result == 'r');
   ASSERT (optarg == NULL);
diff --git a/tests/test-gettimeofday.c b/tests/test-gettimeofday.c
index 892b188..3b85879 100644
--- a/tests/test-gettimeofday.c
+++ b/tests/test-gettimeofday.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2005, 2007 Free Software Foundation
+ * Copyright (C) 2005, 2007, 2009 Free Software Foundation
  * Written by Jim Meyering.
  *
  * This program is free software: you can redistribute it and/or modify
@@ -24,7 +24,7 @@
 #include <string.h>

 int
-main (int argc, char *argv[])
+main (void)
 {
   time_t t = 0;
   struct tm *lt;
diff --git a/tests/test-hash.c b/tests/test-hash.c
index b056d0a..baaab9a 100644
--- a/tests/test-hash.c
+++ b/tests/test-hash.c
@@ -57,7 +57,7 @@ hash_freer (void *x)
 }

 static void
-insert_new (Hash_table *ht, void *ent)
+insert_new (Hash_table *ht, const void *ent)
 {
   void *e = hash_insert (ht, ent);
   ASSERT (e == ent);
@@ -243,11 +243,11 @@ main (int argc, char **argv)
                size_t n = hash_get_n_entries (ht);
                if (n)
                  {
-                   size_t k = rand () % n;
+                   size_t kk = rand () % n;
                    void const *p;
                    void *v;
-                   for (p = hash_get_first (ht); k;
-                        --k, p = hash_get_next (ht, p))
+                   for (p = hash_get_first (ht); kk;
+                        --kk, p = hash_get_next (ht, p))
                      {
                        /* empty */
                      }
diff --git a/tests/test-i-ring.c b/tests/test-i-ring.c
index 05270d7..c08a3ee 100644
--- a/tests/test-i-ring.c
+++ b/tests/test-i-ring.c
@@ -1,5 +1,5 @@
 /* Test the simple ring buffer.
-   Copyright (C) 2006-2008 Free Software Foundation, Inc.
+   Copyright (C) 2006-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 ()
+main (void)
 {
   int o;
   I_ring ir;
diff --git a/tests/test-inttypes.c b/tests/test-inttypes.c
index 10857ae..6126aa0 100644
--- a/tests/test-inttypes.c
+++ b/tests/test-inttypes.c
@@ -1,5 +1,5 @@
 /* Test of <inttypes.h> substitute.
-   Copyright (C) 2006-2007 Free Software Foundation, Inc.
+   Copyright (C) 2006-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
@@ -115,7 +115,7 @@ const char *l = /* implicit string concatenation */
   ;

 int
-main ()
+main (void)
 {
   return 0;
 }
diff --git a/tests/test-link.c b/tests/test-link.c
index a77ffe7..dd7df2e 100644
--- a/tests/test-link.c
+++ b/tests/test-link.c
@@ -44,7 +44,7 @@
 #include "test-link.h"

 int
-main (int argc, char **argv)
+main (void)
 {
   /* Remove any garbage left from previous partial runs.  */
   ASSERT (system ("rm -rf " BASE "*") == 0);
diff --git a/tests/test-linkat.c b/tests/test-linkat.c
index 9740d26..b06b318 100644
--- a/tests/test-linkat.c
+++ b/tests/test-linkat.c
@@ -81,7 +81,7 @@ check_same_link (char const *name1, char const *name2)
 }

 int
-main ()
+main (void)
 {
   int i;
   int dfd;
@@ -134,11 +134,11 @@ main ()
      do the other variant after the loop.  */
   for (i = 0; i < 32; i++)
     {
-      int flag = (i & 0x10 ? AT_SYMLINK_FOLLOW : 0);
       int fd1 = (i & 8) ? dfd : AT_FDCWD;
       char *file1 = file_name_concat ((i & 4) ? ".." : cwd, BASE "xx", NULL);
       int fd2 = (i & 2) ? dfd : AT_FDCWD;
       char *file2 = file_name_concat ((i & 1) ? ".." : cwd, BASE "xx", NULL);
+      flag = (i & 0x10 ? AT_SYMLINK_FOLLOW : 0);

       ASSERT (sprintf (strchr (file1, '\0') - 2, "%02d", i) == 2);
       ASSERT (sprintf (strchr (file2, '\0') - 2, "%02d", i + 1) == 2);
diff --git a/tests/test-lstat.c b/tests/test-lstat.c
index 89edb1f..b8c3d94 100644
--- a/tests/test-lstat.c
+++ b/tests/test-lstat.c
@@ -54,7 +54,7 @@ do_lstat (char const *name, struct stat *st)
 }

 int
-main ()
+main (void)
 {
   return test_lstat_func (do_lstat, true);
 }
diff --git a/tests/test-math.c b/tests/test-math.c
index aa51f85..28f2f12 100644
--- a/tests/test-math.c
+++ b/tests/test-math.c
@@ -1,5 +1,5 @@
 /* Test of <math.h> substitute.
-   Copyright (C) 2007, 2008 Free Software Foundation, Inc.
+   Copyright (C) 2007, 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
@@ -40,7 +40,7 @@ numeric_equal (double x, double y)
 }

 int
-main ()
+main (void)
 {
   double d = NAN;
   double zero = 0.0;
diff --git a/tests/test-md5.c b/tests/test-md5.c
index aeae980..c3f4521 100644
--- a/tests/test-md5.c
+++ b/tests/test-md5.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2005 Free Software Foundation
+ * Copyright (C) 2005, 2009 Free Software Foundation
  * Written by Simon Josefsson
  *
  * This program is free software: you can redistribute it and/or modify
@@ -25,7 +25,7 @@
 #include "md5.h"

 int
-main (int argc, char *argv[])
+main (void)
 {
   /* Test vectors from RFC 1321. */

diff --git a/tests/test-memchr.c b/tests/test-memchr.c
index 1124f8b..a8cfc9b 100644
--- a/tests/test-memchr.c
+++ b/tests/test-memchr.c
@@ -41,7 +41,7 @@
 #define MEMCHR (char *) memchr

 int
-main ()
+main (void)
 {
   size_t n = 0x100000;
   char *input = malloc (n);
@@ -102,8 +102,6 @@ main ()

     if (page_boundary != NULL)
       {
-       int n;
-
        for (n = 1; n <= 500; n++)
          {
            char *mem = page_boundary - n;
diff --git a/tests/test-memchr2.c b/tests/test-memchr2.c
index c7ba6b9..6769aba 100644
--- a/tests/test-memchr2.c
+++ b/tests/test-memchr2.c
@@ -42,7 +42,7 @@
 #define MEMCHR2 (char *) memchr2

 int
-main ()
+main (void)
 {
   size_t n = 0x100000;
   char *input = malloc (n);
diff --git a/tests/test-memrchr.c b/tests/test-memrchr.c
index 63568c1..962fc90 100644
--- a/tests/test-memrchr.c
+++ b/tests/test-memrchr.c
@@ -41,7 +41,7 @@
 #define MEMRCHR (char *) memrchr

 int
-main ()
+main (void)
 {
   size_t n = 0x100000;
   char *input = malloc (n);
diff --git a/tests/test-mkdir.c b/tests/test-mkdir.c
index cc51fce..14c3323 100644
--- a/tests/test-mkdir.c
+++ b/tests/test-mkdir.c
@@ -44,7 +44,7 @@
 #include "test-mkdir.h"

 int
-main ()
+main (void)
 {
   /* Clean up any trash from prior testsuite runs.  */
   ASSERT (system ("rm -rf " BASE "*") == 0);
diff --git a/tests/test-mkdirat.c b/tests/test-mkdirat.c
index 69d90b8..9b59f17 100644
--- a/tests/test-mkdirat.c
+++ b/tests/test-mkdirat.c
@@ -53,7 +53,7 @@ do_mkdir (char const *name, mode_t mode)
 }

 int
-main ()
+main (void)
 {
   int result;

diff --git a/tests/test-mkfifoat.c b/tests/test-mkfifoat.c
index 3853dfe..2992ba2 100644
--- a/tests/test-mkfifoat.c
+++ b/tests/test-mkfifoat.c
@@ -50,7 +50,7 @@ test_mknodat (int fd, char const *name, mode_t mode)
 }

 int
-main ()
+main (void)
 {
   int i;
   test_func funcs[2] = { mkfifoat, test_mknodat };
diff --git a/tests/test-open.c b/tests/test-open.c
index 6b97e18..738934e 100644
--- a/tests/test-open.c
+++ b/tests/test-open.c
@@ -25,7 +25,7 @@
 #include "test-open.h"

 int
-main ()
+main (void)
 {
   return test_open ();
 }
diff --git a/tests/test-openat-safer.c b/tests/test-openat-safer.c
index 221a880..fe9d456 100644
--- a/tests/test-openat-safer.c
+++ b/tests/test-openat-safer.c
@@ -48,7 +48,7 @@ static FILE *myerr;
 #define witness "test-openat-safer.txt"

 int
-main ()
+main (void)
 {
   int i;
   int j;
diff --git a/tests/test-openat.c b/tests/test-openat.c
index 8fa8f83..6e5c519 100644
--- a/tests/test-openat.c
+++ b/tests/test-openat.c
@@ -37,7 +37,7 @@
   while (0)

 int
-main ()
+main (void)
 {
   /* FIXME - add more tests.  For example, share /dev/null and
      trailing slash tests with test-open, and do more checks for
diff --git a/tests/test-posixtm.c b/tests/test-posixtm.c
index 2e17b41..66ca1f7 100644
--- a/tests/test-posixtm.c
+++ b/tests/test-posixtm.c
@@ -28,8 +28,6 @@

 #include "intprops.h"

-#define STREQ(a, b) (strcmp (a, b) == 0)
-
 #define ASSERT(expr) \
   do                                                                        \
     {                                                                       \
@@ -101,7 +99,7 @@ static struct posixtm_test const T[] =
   };

 int
-main (int argc, char **argv)
+main (void)
 {
   unsigned int i;
   int fail = 0;
diff --git a/tests/test-quotearg.c b/tests/test-quotearg.c
index 04891bc..7346cba 100644
--- a/tests/test-quotearg.c
+++ b/tests/test-quotearg.c
@@ -378,7 +378,7 @@ use_quotearg_colon (const char *str, size_t *len)
 }

 int
-main (int argc, char *argv[])
+main (int argc _UNUSED_PARAMETER_, char *argv[])
 {
   int i;
   bool ascii_only = MB_CUR_MAX == 1 && !isprint ((unsigned char) LQ[0]);
diff --git a/tests/test-rawmemchr.c b/tests/test-rawmemchr.c
index 34e70ef..963af39 100644
--- a/tests/test-rawmemchr.c
+++ b/tests/test-rawmemchr.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2008 Free Software Foundation
+ * Copyright (C) 2008, 2009 Free Software Foundation
  * Written by Eric Blake and Bruno Haible
  *
  * This program is free software: you can redistribute it and/or modify
@@ -39,7 +39,7 @@
 #define RAWMEMCHR (char *) rawmemchr

 int
-main ()
+main (void)
 {
   size_t n = 0x100000;
   char *input = malloc (n + 1);
diff --git a/tests/test-readlink.c b/tests/test-readlink.c
index 1fdc2da..78bf342 100644
--- a/tests/test-readlink.c
+++ b/tests/test-readlink.c
@@ -45,7 +45,7 @@
 #include "test-readlink.h"

 int
-main ()
+main (void)
 {
   /* Remove any leftovers from a previous partial run.  */
   ASSERT (system ("rm -rf " BASE "*") == 0);
diff --git a/tests/test-remove.c b/tests/test-remove.c
index 2d5d633..af5d01b 100644
--- a/tests/test-remove.c
+++ b/tests/test-remove.c
@@ -42,7 +42,7 @@
 #define BASE "test-remove.t"

 int
-main ()
+main (void)
 {
   /* Remove any leftovers from a previous partial run.  */
   ASSERT (system ("rm -rf " BASE "*") == 0);
diff --git a/tests/test-rename.c b/tests/test-rename.c
index 7bfdd84..0d51140 100644
--- a/tests/test-rename.c
+++ b/tests/test-rename.c
@@ -44,7 +44,7 @@
 #include "test-rename.h"

 int
-main (int argc, char **argv)
+main (void)
 {
   /* Remove any garbage left from previous partial runs.  */
   ASSERT (system ("rm -rf " BASE "*") == 0);
diff --git a/tests/test-renameat.c b/tests/test-renameat.c
index c69a75f..88c0cb0 100644
--- a/tests/test-renameat.c
+++ b/tests/test-renameat.c
@@ -57,7 +57,7 @@ do_rename (char const *name1, char const *name2)
 }

 int
-main ()
+main (void)
 {
   int i;
   int dfd;
diff --git a/tests/test-rmdir.c b/tests/test-rmdir.c
index 9d8eb5a..642d92c 100644
--- a/tests/test-rmdir.c
+++ b/tests/test-rmdir.c
@@ -44,7 +44,7 @@
 #include "test-rmdir.h"

 int
-main ()
+main (void)
 {
   return test_rmdir_func (rmdir, true);
 }
diff --git a/tests/test-sha1.c b/tests/test-sha1.c
index ac5b495..892f2c8 100644
--- a/tests/test-sha1.c
+++ b/tests/test-sha1.c
@@ -23,7 +23,7 @@
 #include "sha1.h"

 int
-main (int argc, char *argv[])
+main (void)
 {
   const char *in1 = "abcdefgh";
   const char *out1 = "\x42\x5a\xf1\x2a\x07\x43\x50\x2b"
diff --git a/tests/test-sigaction.c b/tests/test-sigaction.c
index c06e6f7..2269b69 100644
--- a/tests/test-sigaction.c
+++ b/tests/test-sigaction.c
@@ -1,5 +1,5 @@
 /* Test of sigaction() 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
@@ -89,7 +89,7 @@ handler (int sig)
 }

 int
-main (int argc, char *argv[])
+main (void)
 {
   struct sigaction sa;
   struct sigaction old_sa;
diff --git a/tests/test-signal.c b/tests/test-signal.c
index 4bc13ab..5154f4e 100644
--- a/tests/test-signal.c
+++ b/tests/test-signal.c
@@ -22,7 +22,8 @@

 volatile sig_atomic_t s;

-int main ()
+int
+main (void)
 {
   return s;
 }
diff --git a/tests/test-stat-time.c b/tests/test-stat-time.c
index 7fb2e93..b88af3d 100644
--- a/tests/test-stat-time.c
+++ b/tests/test-stat-time.c
@@ -254,7 +254,7 @@ test_birthtime (const struct stat *statinfo,
 }

 int
-main ()
+main (void)
 {
   struct stat statinfo[NFILES];
   struct timespec modtimes[NFILES];
diff --git a/tests/test-stat.c b/tests/test-stat.c
index f6777e8..61a9d90 100644
--- a/tests/test-stat.c
+++ b/tests/test-stat.c
@@ -54,7 +54,7 @@ do_stat (char const *name, struct stat *st)
 }

 int
-main ()
+main (void)
 {
   return test_stat_func (do_stat);
 }
diff --git a/tests/test-stddef.c b/tests/test-stddef.c
index f848498..c0a7515 100644
--- a/tests/test-stddef.c
+++ b/tests/test-stddef.c
@@ -32,7 +32,7 @@ size_t c = 2;
 verify (sizeof NULL == sizeof (void *));

 int
-main ()
+main (void)
 {
   return 0;
 }
diff --git a/tests/test-stdint.c b/tests/test-stdint.c
index a2bf42a..4e9b362 100644
--- a/tests/test-stdint.c
+++ b/tests/test-stdint.c
@@ -1,5 +1,5 @@
 /* Test of <stdint.h> substitute.
-   Copyright (C) 2006-2008 Free Software Foundation, Inc.
+   Copyright (C) 2006-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
@@ -354,7 +354,7 @@ verify_same_types (UINTMAX_C (17), (uintmax_t)0 + 0);


 int
-main ()
+main (void)
 {
   return 0;
 }
diff --git a/tests/test-stdio.c b/tests/test-stdio.c
index dcfe38d..3f2f067 100644
--- a/tests/test-stdio.c
+++ b/tests/test-stdio.c
@@ -30,7 +30,7 @@ int sk[] = { SEEK_CUR, SEEK_END, SEEK_SET };
 verify (sizeof NULL == sizeof (void *));

 int
-main ()
+main (void)
 {
   return 0;
 }
diff --git a/tests/test-stdlib.c b/tests/test-stdlib.c
index ae46ba1..fad5cf4 100644
--- a/tests/test-stdlib.c
+++ b/tests/test-stdlib.c
@@ -29,7 +29,7 @@ int exitcode;
 verify (sizeof NULL == sizeof (void *));

 int
-main ()
+main (void)
 {
   /* Check that some macros are defined and different integer constants.  */
   switch (exitcode)
diff --git a/tests/test-strchrnul.c b/tests/test-strchrnul.c
index dc55066..ea882e5 100644
--- a/tests/test-strchrnul.c
+++ b/tests/test-strchrnul.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2008 Free Software Foundation
+ * Copyright (C) 2008, 2009 Free Software Foundation
  * Written by Eric Blake and Bruno Haible
  *
  * This program is free software: you can redistribute it and/or modify
@@ -35,7 +35,7 @@
   while (0)

 int
-main ()
+main (void)
 {
   size_t n = 0x100000;
   char *input = malloc (n + 1);
diff --git a/tests/test-strerror.c b/tests/test-strerror.c
index 3d9814d..27eb969 100644
--- a/tests/test-strerror.c
+++ b/tests/test-strerror.c
@@ -1,5 +1,5 @@
 /* Test of strerror() 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
@@ -37,7 +37,7 @@
   while (0)

 int
-main (int argc, char **argv)
+main (void)
 {
   char *str;

diff --git a/tests/test-string.c b/tests/test-string.c
index fe53cd9..69df747 100644
--- a/tests/test-string.c
+++ b/tests/test-string.c
@@ -27,7 +27,7 @@
 verify (sizeof NULL == sizeof (void *));

 int
-main ()
+main (void)
 {
   return 0;
 }
diff --git a/tests/test-strtod.c b/tests/test-strtod.c
index d99e5fe..69dd474 100644
--- a/tests/test-strtod.c
+++ b/tests/test-strtod.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2008 Free Software Foundation
+ * Copyright (C) 2008, 2009 Free Software Foundation
  * Written by Eric Blake
  *
  * This program is free software: you can redistribute it and/or modify
@@ -47,7 +47,7 @@
 double zero = 0.0;

 int
-main ()
+main (void)
 {
   int status = 0;
   /* Subject sequence empty or invalid.  */
diff --git a/tests/test-strverscmp.c b/tests/test-strverscmp.c
index 04da20c..a98695b 100644
--- a/tests/test-strverscmp.c
+++ b/tests/test-strverscmp.c
@@ -1,5 +1,5 @@
 /* Test of strverscmp() 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
@@ -37,7 +37,7 @@
   while (0)

 int
-main (int argc, char **argv)
+main (void)
 {
   ASSERT (strverscmp ("", "") == 0);
   ASSERT (strverscmp ("a", "a") == 0);
diff --git a/tests/test-symlink.c b/tests/test-symlink.c
index 9f39090..26e97d0 100644
--- a/tests/test-symlink.c
+++ b/tests/test-symlink.c
@@ -44,7 +44,7 @@
 #include "test-symlink.h"

 int
-main ()
+main (void)
 {
   /* Remove any leftovers from a previous partial run.  */
   ASSERT (system ("rm -rf " BASE "*") == 0);
diff --git a/tests/test-symlinkat.c b/tests/test-symlinkat.c
index 3b542e3..9930872 100644
--- a/tests/test-symlinkat.c
+++ b/tests/test-symlinkat.c
@@ -64,7 +64,7 @@ do_readlink (char const *name, char *buf, size_t len)
 }

 int
-main ()
+main (void)
 {
   char buf[80];
   int result;
diff --git a/tests/test-sys_stat.c b/tests/test-sys_stat.c
index a73f9b8..4a85c9f 100644
--- a/tests/test-sys_stat.c
+++ b/tests/test-sys_stat.c
@@ -282,7 +282,7 @@ nlink_t t1;
 struct timespec t2;

 int
-main ()
+main (void)
 {
   return 0;
 }
diff --git a/tests/test-sys_time.c b/tests/test-sys_time.c
index bae4108..74f35ac 100644
--- a/tests/test-sys_time.c
+++ b/tests/test-sys_time.c
@@ -1,5 +1,5 @@
 /* Test of <sys/time.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
@@ -23,7 +23,7 @@
 struct timeval a;

 int
-main ()
+main (void)
 {
   return 0;
 }
diff --git a/tests/test-time.c b/tests/test-time.c
index ea81437..4afa3b3 100644
--- a/tests/test-time.c
+++ b/tests/test-time.c
@@ -29,7 +29,7 @@ struct timespec a;
 verify (sizeof NULL == sizeof (void *));

 int
-main ()
+main (void)
 {
   return 0;
 }
diff --git a/tests/test-unistd.c b/tests/test-unistd.c
index 129367b..dd907f4 100644
--- a/tests/test-unistd.c
+++ b/tests/test-unistd.c
@@ -50,7 +50,7 @@ intptr_t t8;
 #endif

 int
-main ()
+main (void)
 {
   return 0;
 }
diff --git a/tests/test-unlink.c b/tests/test-unlink.c
index 0c8dc6f..3d7a875 100644
--- a/tests/test-unlink.c
+++ b/tests/test-unlink.c
@@ -47,7 +47,7 @@
 #include "test-unlink.h"

 int
-main ()
+main (void)
 {
   return test_unlink_func (unlink, true);
 }
diff --git a/tests/test-unlinkat.c b/tests/test-unlinkat.c
index 851ffe7..8fa9643 100644
--- a/tests/test-unlinkat.c
+++ b/tests/test-unlinkat.c
@@ -63,7 +63,7 @@ unlinker (char const *name)
 }

 int
-main ()
+main (void)
 {
   /* FIXME: Add tests of fd other than ".".  */
   int result1;
diff --git a/tests/test-utimens.c b/tests/test-utimens.c
index 651ea9b..a36f042 100644
--- a/tests/test-utimens.c
+++ b/tests/test-utimens.c
@@ -69,7 +69,7 @@ do_fdutimens (char const *name, struct timespec const 
times[2])
 }

 int
-main ()
+main (void)
 {
   int result1; /* Skip because of no symlink support.  */
   int result2; /* Skip because of no futimens support.  */
diff --git a/tests/test-utimensat.c b/tests/test-utimensat.c
index 8dc0cc9..35fd1bf 100644
--- a/tests/test-utimensat.c
+++ b/tests/test-utimensat.c
@@ -66,7 +66,7 @@ do_lutimensat (char const *name, struct timespec const 
times[2])
 }

 int
-main ()
+main (void)
 {
   int result1; /* Skip because of no symlink support.  */
   int result2; /* Skip because of no lutimens support.  */
diff --git a/tests/test-version-etc.c b/tests/test-version-etc.c
index 71cbc8b..9ff97c4 100644
--- a/tests/test-version-etc.c
+++ b/tests/test-version-etc.c
@@ -24,7 +24,7 @@
 #define AUTHORS "Sergey Poznyakoff", "Eric Blake"

 int
-main (int argc, char **argv)
+main (int argc _UNUSED_PARAMETER_, char **argv)
 {
   set_program_name (argv[0]);
   version_etc (stdout, "test-version-etc", "dummy", "0", AUTHORS,
diff --git a/tests/test-wchar.c b/tests/test-wchar.c
index 2866068..2e60bb8 100644
--- a/tests/test-wchar.c
+++ b/tests/test-wchar.c
@@ -31,7 +31,7 @@ wint_t b = 'x';
 verify (sizeof NULL == sizeof (void *));

 int
-main ()
+main (void)
 {
   return 0;
 }
diff --git a/tests/test-wctype.c b/tests/test-wctype.c
index 5deae45..a39514a 100644
--- a/tests/test-wctype.c
+++ b/tests/test-wctype.c
@@ -41,7 +41,7 @@ wint_t a = 'x';
 wint_t e = WEOF;

 int
-main ()
+main (void)
 {
   /* Check that the isw* functions exist as functions or as macros.  */
   (void) iswalnum (0);
diff --git a/tests/test-xprintf-posix.c b/tests/test-xprintf-posix.c
index 62c9b95..a5ab726 100644
--- a/tests/test-xprintf-posix.c
+++ b/tests/test-xprintf-posix.c
@@ -1,5 +1,5 @@
 /* Test of error-checking xprintf() 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
@@ -43,7 +43,7 @@
 #include "test-printf-posix.h"

 int
-main (int argc, char *argv[])
+main (int argc _UNUSED_PARAMETER_, char *argv[])
 {
   set_program_name (argv[0]);

-- 
1.6.5.rc1


reply via email to

[Prev in Thread] Current Thread [Next in Thread]