This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [COMMITTED PATCH] suppress new -Wunused-but-set warnings in GMPcode


On 08/16/2012 11:11 PM, Roland McGrath wrote:
2012-08-16 Roland McGrath <roland@hack.frob.com>

	* stdlib/gmp-impl.h (udiv_qrnnd_preinv): Use __attribute__ ((unused))
	on _QL, which is set by umul_ppmm but never used.
	* stdio-common/_itoa.c (_itoa): Use __attribute__ ((unused)) on DUMMY
	variables, which are set by GMP macros but never used.
	* stdio-common/_itowa.c (_itowa): Likewise.
	* stdlib/divmod_1.c (mpn_divmod_1): Likewise.
	* stdlib/mod_1.c (mpn_mod_1): Likewise.


diff --git a/stdio-common/_itoa.c b/stdio-common/_itoa.c index ebb3e85..4c588d9 100644 --- a/stdio-common/_itoa.c +++ b/stdio-common/_itoa.c @@ -264,7 +264,8 @@ _itoa (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 __attribute__ ((unused));

  	      umul_ppmm (x, dummy, value, base_multiplier);
  	      quo = (x + ((value - x) >> 1)) >> (brec->post_shift - 1);
@@ -275,7 +276,8 @@ _itoa (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 __attribute__ ((unused));

these two miss the "dummy" variable.


Fixed with the appended patch, committed as obvious,

Andreas

2012-08-18 Andreas Jaeger <aj@suse.de>

* stdio-common/_itoa.c (_itoa): Add missing DUMMY variable.

 	* include/sys/socket.h (__have_sock_cloexec): Add attribute_hidden.
diff --git a/stdio-common/_itoa.c b/stdio-common/_itoa.c
index 4c588d9..6759231 100644
--- a/stdio-common/_itoa.c
+++ b/stdio-common/_itoa.c
@@ -265,7 +265,7 @@ _itoa (value, buflim, base, upper_case)
 	  while (value != 0)
 	    {
 	      mp_limb_t quo, rem, x;
-	      mp_limb_t __attribute__ ((unused));
+	      mp_limb_t dummy __attribute__ ((unused));

 	      umul_ppmm (x, dummy, value, base_multiplier);
 	      quo = (x + ((value - x) >> 1)) >> (brec->post_shift - 1);
@@ -277,7 +277,7 @@ _itoa (value, buflim, base, upper_case)
 	  while (value != 0)
 	    {
 	      mp_limb_t quo, rem, x;
-	      mp_limb_t __attribute__ ((unused));
+	      mp_limb_t dummy __attribute__ ((unused));

 	      umul_ppmm (x, dummy, value, base_multiplier);
 	      quo = x >> brec->post_shift;

--
 Andreas Jaeger aj@{suse.com,opensuse.org} Twitter/Identica: jaegerandi
  SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
   GF: Jeff Hawn,Jennifer Guild,Felix Imendörffer,HRB16746 (AG Nürnberg)
    GPG fingerprint = 93A3 365E CE47 B889 DF7F  FED1 389A 563C C272 A126


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]