build: avoid compiler warnings
authorEric Blake <ebb9@byu.net>
Fri, 30 Oct 2009 15:47:12 +0000 (09:47 -0600)
committerEric Blake <ebb9@byu.net>
Fri, 30 Oct 2009 23:02:08 +0000 (17:02 -0600)
* 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 <ebb9@byu.net>
ChangeLog
lib/fchmodat.c
lib/getopt.c
lib/inttostr.c
lib/mktime.c
lib/uinttostr.c
lib/umaxtostr.c

index 6cb34dc..e9515dd 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2009-10-30  Eric Blake  <ebb9@byu.net>
+
+       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  <michael.haubenwallner@salomon.at>
 
        stat: fix compilation on AIX
index 55ae618..62a5d05 100644 (file)
    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.
index f1e6d1f..797d166 100644 (file)
@@ -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 drepper@gnu.org
    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
index ed6a693..749aea7 100644 (file)
@@ -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
 
 /* 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;
index a42c771..8690329 100644 (file)
@@ -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) -
index 52d288e..d6fc964 100644 (file)
@@ -1,3 +1,4 @@
 #define inttostr uinttostr
 #define inttype unsigned int
+#define inttype_is_unsigned
 #include "inttostr.c"
index 4f49a7f..75346a4 100644 (file)
@@ -1,3 +1,4 @@
 #define inttostr umaxtostr
 #define inttype uintmax_t
+#define inttype_is_unsigned
 #include "inttostr.c"