Mercurial > hg > octave-nkf > gnulib-hg
changeset 12220:1785ef4dfcdf
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 <ebb9@byu.net>
author | Eric Blake <ebb9@byu.net> |
---|---|
date | Fri, 30 Oct 2009 09:47:12 -0600 |
parents | cbf8d59f676a |
children | a12bc0c11a21 |
files | ChangeLog lib/fchmodat.c lib/getopt.c lib/inttostr.c lib/mktime.c lib/uinttostr.c lib/umaxtostr.c |
diffstat | 7 files changed, 28 insertions(+), 9 deletions(-) [+] |
line wrap: on
line diff
--- 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
--- 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.
--- 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 @@ /* 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
--- 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 @@ char *p = buf + INT_STRLEN_BOUND (inttype); *p = 0; +#ifndef inttype_is_unsigned if (i < 0) { do @@ -45,6 +41,7 @@ *--p = '-'; } else +#endif { do *--p = '0' + i % 10;
--- a/lib/mktime.c +++ b/lib/mktime.c @@ -147,6 +147,9 @@ # 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) -