From: Eric Blake Date: Fri, 30 Oct 2009 15:47:12 +0000 (-0600) Subject: build: avoid compiler warnings X-Git-Tag: v0.1~5267 X-Git-Url: http://erislabs.org.uk/gitweb/?a=commitdiff_plain;h=708e2420452bb7233e0153b0b92c4e7dc79e03e3;p=gnulib.git 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 --- diff --git a/ChangeLog b/ChangeLog index 6cb34dcf3..e9515ddde 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2009-10-30 Eric Blake + + 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 stat: fix compilation on AIX diff --git a/lib/fchmodat.c b/lib/fchmodat.c index 55ae61836..62a5d0566 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 f1e6d1f7c..797d166f1 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 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 diff --git a/lib/inttostr.c b/lib/inttostr.c index ed6a6933d..749aea7f6 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 #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 a42c77154..869032981 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 52d288e44..d6fc9645a 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 4f49a7f8d..75346a44f 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"