changeset 12481:f5dcba492f50

tests: avoid compiler warnings Silence more warnings during coreutils build. * tests/test-fcntl.c (main): Delete unused parameters. * tests/test-freopen-safer.c (main): Likewise. * tests/test-xalloc-die.c (main): Mark unused parameters. * tests/test-fseeko.c (main): Likewise. * tests/test-ftello.c (main): Likewise. * tests/test-nanosleep.c (main): Avoid declaration warning. * tests/test-sleep.c (main): Likewise. * tests/test-unsetenv.c (main): Silence warning about string literal. * m4/setenv.m4 (gl_FUNC_UNSETENV): Likewise. Signed-off-by: Eric Blake <ebb9@byu.net>
author Eric Blake <ebb9@byu.net>
date Tue, 22 Dec 2009 15:03:48 -0700
parents 4756a0883f46
children 11bc92a9e2bc
files ChangeLog m4/setenv.m4 tests/test-fcntl.c tests/test-freopen-safer.c tests/test-fseeko.c tests/test-ftello.c tests/test-nanosleep.c tests/test-sleep.c tests/test-unsetenv.c tests/test-xalloc-die.c
diffstat 10 files changed, 24 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2009-12-23  Eric Blake  <ebb9@byu.net>
+
+	tests: avoid compiler warnings
+	* tests/test-fcntl.c (main): Delete unused parameters.
+	* tests/test-freopen-safer.c (main): Likewise.
+	* tests/test-xalloc-die.c (main): Mark unused parameters.
+	* tests/test-fseeko.c (main): Likewise.
+	* tests/test-ftello.c (main): Likewise.
+	* tests/test-nanosleep.c (main): Avoid declaration warning.
+	* tests/test-sleep.c (main): Likewise.
+	* tests/test-unsetenv.c (main): Silence warning about string
+	literal.
+	* m4/setenv.m4 (gl_FUNC_UNSETENV): Likewise.
+
 2009-12-23  Bruno Haible  <bruno@clisp.org>
 
 	* tests/test-localename.c (test_locale_name): New function, extracted
--- a/m4/setenv.m4
+++ b/m4/setenv.m4
@@ -1,4 +1,4 @@
-# setenv.m4 serial 14
+# setenv.m4 serial 15
 dnl Copyright (C) 2001-2004, 2006-2009 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -77,7 +77,7 @@
        #include <stdlib.h>
       ]], [[
        char entry[] = "b=2";
-       if (putenv ("a=1")) return 1;
+       if (putenv ((char *) "a=1")) return 1;
        if (putenv (entry)) return 2;
        entry[0] = 'a';
        unsetenv ("a");
--- a/tests/test-fcntl.c
+++ b/tests/test-fcntl.c
@@ -220,7 +220,7 @@
 }
 
 int
-main (int argc, char **argv)
+main (void)
 {
   const char *file = "test-fcntl.tmp";
   int fd;
--- a/tests/test-freopen-safer.c
+++ b/tests/test-freopen-safer.c
@@ -45,7 +45,7 @@
   while (0)
 
 int
-main (int argc, char **argv)
+main (void)
 {
   FILE *fp;
 
--- a/tests/test-fseeko.c
+++ b/tests/test-fseeko.c
@@ -45,7 +45,7 @@
 #endif
 
 int
-main (int argc, char **argv)
+main (int argc, char **argv _UNUSED_PARAMETER_)
 {
   /* Assume stdin is non-empty, seekable, and starts with '#!/bin/sh'
      iff argc > 1.  */
--- a/tests/test-ftello.c
+++ b/tests/test-ftello.c
@@ -46,7 +46,7 @@
 #endif
 
 int
-main (int argc, char **argv)
+main (int argc, char **argv _UNUSED_PARAMETER_)
 {
   int ch;
   /* Assume stdin is seekable iff argc > 1.  */
--- a/tests/test-nanosleep.c
+++ b/tests/test-nanosleep.c
@@ -50,7 +50,7 @@
 #endif
 
 int
-main()
+main (void)
 {
   struct timespec ts;
 
--- a/tests/test-sleep.c
+++ b/tests/test-sleep.c
@@ -46,7 +46,7 @@
 #endif
 
 int
-main()
+main (void)
 {
   ASSERT (sleep (1) <= 1);
 
--- a/tests/test-unsetenv.c
+++ b/tests/test-unsetenv.c
@@ -43,7 +43,7 @@
   char entry[] = "b=2";
 
   /* Test removal when multiple entries present.  */
-  ASSERT (putenv ("a=1") == 0);
+  ASSERT (putenv ((char *) "a=1") == 0);
   ASSERT (putenv (entry) == 0);
   entry[0] = 'a'; /* Unspecified what getenv("a") would be at this point.  */
   ASSERT (unsetenv ("a") == 0); /* Both entries will be removed.  */
--- a/tests/test-xalloc-die.c
+++ b/tests/test-xalloc-die.c
@@ -22,7 +22,7 @@
 #include "progname.h"
 
 int
-main (int argc, char **argv)
+main (int argc _UNUSED_PARAMETER_, char **argv)
 {
   set_program_name (argv[0]);
   xalloc_die ();