bug-gnulib
[Top][All Lists]
Advanced

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

more warnings patrol


From: Eric Blake
Subject: more warnings patrol
Date: Fri, 30 Oct 2009 18:10:46 -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

I'm committing this, to silence some unused variables, and to make
inttostr.c quiet even on older gcc.

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

iEYEARECAAYFAkrrgIYACgkQ84KuGfSFAYDz1QCgxmsY+DjF9/oH3g9YvIHiilRf
Rl0AoLnLmXNSaIt2SjbQ9rk6W/CfGCDe
=IDiH
-----END PGP SIGNATURE-----
>From 708e2420452bb7233e0153b0b92c4e7dc79e03e3 Mon Sep 17 00:00:00 2001
From: Eric Blake <address@hidden>
Date: Fri, 30 Oct 2009 09:47:12 -0600
Subject: [PATCH] build: avoid compiler warnings

* lib/fchmodat.c (lchmod): Mark unused variables.
* lib/getopt.c (_getopt_initialize): Likewise.
* lib/mktime.c (__mktime_internal): Provide prototype.
* lib/inttostr.c (inttostr): Avoid compiler warning even with
older gcc that do not understand #pragma GCC diagnostic.
* lib/uinttostr.c (inttype_is_unsigned): Define.
* lib/umaxtostr.c (inttype_is_unsigned): Likewise.

Signed-off-by: Eric Blake <address@hidden>
---
 ChangeLog       |   11 +++++++++++
 lib/fchmodat.c  |    7 ++++++-
 lib/getopt.c    |    5 +++--
 lib/inttostr.c  |    9 +++------
 lib/mktime.c    |    3 +++
 lib/uinttostr.c |    1 +
 lib/umaxtostr.c |    1 +
 7 files changed, 28 insertions(+), 9 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 6cb34dc..e9515dd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2009-10-30  Eric Blake  <address@hidden>
+
+       build: avoid compiler warnings
+       * lib/fchmodat.c (lchmod): Mark unused variables.
+       * lib/getopt.c (_getopt_initialize): Likewise.
+       * lib/mktime.c (__mktime_internal): Provide prototype.
+       * lib/inttostr.c (inttostr): Avoid compiler warning even with
+       older gcc that do not understand #pragma GCC diagnostic.
+       * lib/uinttostr.c (inttype_is_unsigned): Define.
+       * lib/umaxtostr.c (inttype_is_unsigned): Likewise.
+
 2009-10-30  Michael Haubenwallner  <address@hidden>

        stat: fix compilation on AIX
diff --git a/lib/fchmodat.c b/lib/fchmodat.c
index 55ae618..62a5d05 100644
--- a/lib/fchmodat.c
+++ b/lib/fchmodat.c
@@ -27,7 +27,12 @@
    system-supplied declaration.  */
 # undef lchmod
 # define lchmod lchmod_rpl
-static int lchmod (char const *f, mode_t m) { errno = ENOSYS; return -1; }
+static int
+lchmod (char const *f _UNUSED_PARAMETER_, mode_t m _UNUSED_PARAMETER_)
+{
+  errno = ENOSYS;
+  return -1;
+}
 #endif

 /* Solaris 10 has no function like this.
diff --git a/lib/getopt.c b/lib/getopt.c
index f1e6d1f..797d166 100644
--- a/lib/getopt.c
+++ b/lib/getopt.c
@@ -2,7 +2,7 @@
    NOTE: getopt is now part of the C library, so if you don't know what
    "Keep this file name-space clean" means, talk to address@hidden
    before changing it!
-   Copyright (C) 
1987,88,89,90,91,92,93,94,95,96,98,99,2000,2001,2002,2003,2004,2006,2008
+   Copyright (C) 
1987,88,89,90,91,92,93,94,95,96,98,99,2000,2001,2002,2003,2004,2006,2008,2009
        Free Software Foundation, Inc.
    This file is part of the GNU C Library.

@@ -225,7 +225,8 @@ exchange (char **argv, struct _getopt_data *d)
 /* Initialize the internal data when the first call is made.  */

 static const char *
-_getopt_initialize (int argc, char **argv, const char *optstring,
+_getopt_initialize (int argc _UNUSED_PARAMETER_,
+                   char **argv _UNUSED_PARAMETER_, const char *optstring,
                    int posixly_correct, struct _getopt_data *d)
 {
   /* Start processing options with ARGV-element 1 (since ARGV-element 0
diff --git a/lib/inttostr.c b/lib/inttostr.c
index ed6a693..749aea7 100644
--- a/lib/inttostr.c
+++ b/lib/inttostr.c
@@ -1,6 +1,6 @@
 /* inttostr.c -- convert integers to printable strings

-   Copyright (C) 2001, 2006, 2008 Free Software Foundation, Inc.
+   Copyright (C) 2001, 2006, 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
@@ -17,11 +17,6 @@

 /* Written by Paul Eggert */

-/* Tell gcc not to warn about the (i < 0) test, below.  */
-#if (__GNUC__ == 4 && 3 <= __GNUC_MINOR__) || 4 < __GNUC__
-# pragma GCC diagnostic ignored "-Wtype-limits"
-#endif
-
 #include <config.h>

 #include "inttostr.h"
@@ -36,6 +31,7 @@ inttostr (inttype i, char *buf)
   char *p = buf + INT_STRLEN_BOUND (inttype);
   *p = 0;

+#ifndef inttype_is_unsigned
   if (i < 0)
     {
       do
@@ -45,6 +41,7 @@ inttostr (inttype i, char *buf)
       *--p = '-';
     }
   else
+#endif
     {
       do
        *--p = '0' + i % 10;
diff --git a/lib/mktime.c b/lib/mktime.c
index a42c771..8690329 100644
--- a/lib/mktime.c
+++ b/lib/mktime.c
@@ -147,6 +147,9 @@ const unsigned short int __mon_yday[2][13] =
 # undef __localtime_r
 # define __localtime_r localtime_r
 # define __mktime_internal mktime_internal
+time_t __mktime_internal (struct tm *,
+                         struct tm * (*) (time_t const *, struct tm *),
+                         time_t *);
 #endif

 /* Return an integer value measuring (YEAR1-YDAY1 HOUR1:MIN1:SEC1) -
diff --git a/lib/uinttostr.c b/lib/uinttostr.c
index 52d288e..d6fc964 100644
--- a/lib/uinttostr.c
+++ b/lib/uinttostr.c
@@ -1,3 +1,4 @@
 #define inttostr uinttostr
 #define inttype unsigned int
+#define inttype_is_unsigned
 #include "inttostr.c"
diff --git a/lib/umaxtostr.c b/lib/umaxtostr.c
index 4f49a7f..75346a4 100644
--- a/lib/umaxtostr.c
+++ b/lib/umaxtostr.c
@@ -1,3 +1,4 @@
 #define inttostr umaxtostr
 #define inttype uintmax_t
+#define inttype_is_unsigned
 #include "inttostr.c"
-- 
1.6.5.rc1


reply via email to

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