tests: avoid compiler warnings
authorEric Blake <ebb9@byu.net>
Tue, 22 Dec 2009 22:03:48 +0000 (15:03 -0700)
committerEric Blake <ebb9@byu.net>
Wed, 23 Dec 2009 13:45:58 +0000 (06:45 -0700)
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>
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

index 1a70eb78f5e765e10b728aaea371b594e35402f0..28f92b027ebaab01cd35e2ef45b92b91cdc9a69d 100644 (file)
--- 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
index 29e6866742b5445bd08a98c72483186a45c199d0..a4cfb9eceaf6d8fd53b51c591bf3af3ac26cb026 100644 (file)
@@ -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 @@ int unsetenv();
        #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");
index 8ea130101defdfa9660766c8a236153c01826506..c06b41e618f6e5b14a33cd8bf2eb4b0c4691c5aa 100644 (file)
@@ -220,7 +220,7 @@ check_flags (void)
 }
 
 int
-main (int argc, char **argv)
+main (void)
 {
   const char *file = "test-fcntl.tmp";
   int fd;
index d1bbe8d57ad0626c1095f87b953f3d865203bf48..40ba8872d448b45574f4cf4c80a0f5f3ea39c45c 100644 (file)
@@ -45,7 +45,7 @@ static FILE *myerr;
   while (0)
 
 int
-main (int argc, char **argv)
+main (void)
 {
   FILE *fp;
 
index 4006e1ebed33ebc6264b3a48973ae6995c101a8b..037c7f5ecd8f966d424fab7f7271f59386f67fb1 100644 (file)
@@ -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.  */
index f3183c8ecd25d971d5b7a447f57d4a5489a67645..ab5c456552ae9246f262216cc6b2a0cc4a17e0c4 100644 (file)
@@ -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.  */
index eb4bef67a3a1ad5e813945999475f967e3e914af..426ea999f13048b78537c496c345763ac40421e9 100644 (file)
@@ -50,7 +50,7 @@ handle_alarm (int sig)
 #endif
 
 int
-main()
+main (void)
 {
   struct timespec ts;
 
index 48abce12f6c9268f6e8e99c2acac60d98679e56a..8840142ac9d8d1b8a20c36741056bd807b107f3c 100644 (file)
@@ -46,7 +46,7 @@ handle_alarm (int sig)
 #endif
 
 int
-main()
+main (void)
 {
   ASSERT (sleep (1) <= 1);
 
index 2815cf3a398a806d96bb53686192847613ebad52..bd312a04b5ac73742e27c8854f0ff4f521acc0b7 100644 (file)
@@ -43,7 +43,7 @@ main (void)
   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.  */
index 4a03a0bc5769fcb6568e21786c014f15baaa2964..8b190d062ab2c480ddcf19d1e0341cc6827901d2 100644 (file)
@@ -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 ();