bug-gnulib
[Top][All Lists]
Advanced

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

fewer test warnings


From: Eric Blake
Subject: fewer test warnings
Date: Wed, 23 Dec 2009 06:45:11 -0700
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

I'm applying this, noticed during 'make check' on coreutils:

- --
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/

iEYEARECAAYFAksyHuYACgkQ84KuGfSFAYBu6wCgzoV3l6SucDLi+2qLSIghpDN1
DYIAnjxK6QWaFBWhOaVEU7PN7Z1kqYfM
=l+4d
-----END PGP SIGNATURE-----
>From 09cc451abae143de1bf1109eb647748f6a09f70e Mon Sep 17 00:00:00 2001
From: Eric Blake <address@hidden>
Date: Tue, 22 Dec 2009 15:03:48 -0700
Subject: [PATCH] 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 <address@hidden>
---
 ChangeLog                  |   14 ++++++++++++++
 m4/setenv.m4               |    4 ++--
 tests/test-fcntl.c         |    2 +-
 tests/test-freopen-safer.c |    2 +-
 tests/test-fseeko.c        |    2 +-
 tests/test-ftello.c        |    2 +-
 tests/test-nanosleep.c     |    2 +-
 tests/test-sleep.c         |    2 +-
 tests/test-unsetenv.c      |    2 +-
 tests/test-xalloc-die.c    |    2 +-
 10 files changed, 24 insertions(+), 10 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 1a70eb7..07941f0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2009-12-22  Eric Blake  <address@hidden>
+
+       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  <address@hidden>

        * tests/test-localename.c (test_locale_name): New function, extracted
diff --git a/m4/setenv.m4 b/m4/setenv.m4
index 29e6866..a4cfb9e 100644
--- 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 @@ 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");
diff --git a/tests/test-fcntl.c b/tests/test-fcntl.c
index 8ea1301..c06b41e 100644
--- a/tests/test-fcntl.c
+++ b/tests/test-fcntl.c
@@ -220,7 +220,7 @@ check_flags (void)
 }

 int
-main (int argc, char **argv)
+main (void)
 {
   const char *file = "test-fcntl.tmp";
   int fd;
diff --git a/tests/test-freopen-safer.c b/tests/test-freopen-safer.c
index d1bbe8d..40ba887 100644
--- a/tests/test-freopen-safer.c
+++ b/tests/test-freopen-safer.c
@@ -45,7 +45,7 @@ static FILE *myerr;
   while (0)

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

diff --git a/tests/test-fseeko.c b/tests/test-fseeko.c
index 4006e1e..037c7f5 100644
--- 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.  */
diff --git a/tests/test-ftello.c b/tests/test-ftello.c
index f3183c8..ab5c456 100644
--- 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.  */
diff --git a/tests/test-nanosleep.c b/tests/test-nanosleep.c
index eb4bef6..426ea99 100644
--- a/tests/test-nanosleep.c
+++ b/tests/test-nanosleep.c
@@ -50,7 +50,7 @@ handle_alarm (int sig)
 #endif

 int
-main()
+main (void)
 {
   struct timespec ts;

diff --git a/tests/test-sleep.c b/tests/test-sleep.c
index 48abce1..8840142 100644
--- a/tests/test-sleep.c
+++ b/tests/test-sleep.c
@@ -46,7 +46,7 @@ handle_alarm (int sig)
 #endif

 int
-main()
+main (void)
 {
   ASSERT (sleep (1) <= 1);

diff --git a/tests/test-unsetenv.c b/tests/test-unsetenv.c
index 2815cf3..bd312a0 100644
--- a/tests/test-unsetenv.c
+++ b/tests/test-unsetenv.c
@@ -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.  */
diff --git a/tests/test-xalloc-die.c b/tests/test-xalloc-die.c
index 4a03a0b..8b190d0 100644
--- 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 ();
-- 
1.6.4.2


reply via email to

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