summaryrefslogtreecommitdiff
path: root/lib/inttostr.c
diff options
context:
space:
mode:
authorEric Blake <ebb9@byu.net>2009-10-30 09:47:12 -0600
committerEric Blake <ebb9@byu.net>2009-10-30 17:02:08 -0600
commit708e2420452bb7233e0153b0b92c4e7dc79e03e3 (patch)
treed49fe03fc7ba5e0d40e6cbf2e4ed078d60cd47b3 /lib/inttostr.c
parent298d8b4a29e66da0b046b64b822f97d1c8fef74b (diff)
downloadgnulib-708e2420452bb7233e0153b0b92c4e7dc79e03e3.tar.gz
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>
Diffstat (limited to 'lib/inttostr.c')
-rw-r--r--lib/inttostr.c9
1 files changed, 3 insertions, 6 deletions
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 <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;