From 708e2420452bb7233e0153b0b92c4e7dc79e03e3 Mon Sep 17 00:00:00 2001 From: Eric Blake Date: Fri, 30 Oct 2009 09:47:12 -0600 Subject: 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 --- lib/inttostr.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'lib/inttostr.c') diff --git a/lib/inttostr.c b/lib/inttostr.c index ed6a6933de..749aea7f6f 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; -- cgit v1.2.1