Fix more set-but-not-used warnings in _itowa.c
Joseph S. Myers
joseph@codesourcery.com
Mon Nov 19 23:59:00 GMT 2012
stdio-common/_itowa.c calls the macro umul_ppmm with a "dummy"
variable for the low part of the result, whose value is not used. To
avoid set-but-not-used warnings, this variable needs to be declared
with __attribute__ ((unused)). Roland fixed some cases with
commit db1ee0a836f4938dc14014c6341fcb11ef66e929
Author: Roland McGrath <roland@hack.frob.com>
Date: Thu Aug 16 14:08:47 2012 -0700
Suppress -Wunused-but-set warnings in GMP code.
but other cases were left unchanged, leaving some warnings seen on
MIPS; this patch fixes those cases as well. Tested that this
eliminates the warnings seen for MIPS.
2012-11-19 Joseph Myers <joseph@codesourcery.com>
* stdio-common/_itowa.c (_itowa) [BITS_PER_MP_LIMB == 64]: Declare
DUMMY variables with __attribute__ ((unused)).
diff --git a/stdio-common/_itowa.c b/stdio-common/_itowa.c
index 6561ee1..f50893d 100644
--- a/stdio-common/_itowa.c
+++ b/stdio-common/_itowa.c
@@ -159,7 +159,8 @@ _itowa (value, buflim, base, upper_case)
if (brec->flag)
while (value != 0)
{
- mp_limb_t quo, rem, x, dummy;
+ mp_limb_t quo, rem, x;
+ mp_limb_t dummy __attribute__ ((unused));
umul_ppmm (x, dummy, value, base_multiplier);
quo = (x + ((value - x) >> 1)) >> (brec->post_shift - 1);
@@ -170,7 +171,8 @@ _itowa (value, buflim, base, upper_case)
else
while (value != 0)
{
- mp_limb_t quo, rem, x, dummy;
+ mp_limb_t quo, rem, x;
+ mp_limb_t dummy __attribute__ ((unused));
umul_ppmm (x, dummy, value, base_multiplier);
quo = x >> brec->post_shift;
--
Joseph S. Myers
joseph@codesourcery.com
More information about the Libc-alpha
mailing list