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]

[PATCH] dbl-64/e_sqrt.c: fix -Wunused-variable


EMULV() doesn't need p, hx, tx and ty if DLA_FMS is defined.
If that variables are needed for EMULV() only, GCC warns about
unused variables, like this:

../sysdeps/ieee754/dbl-64/e_sqrt.c: In function ‘__ieee754_sqrt’:
../sysdeps/ieee754/dbl-64/e_sqrt.c:56:54: warning: unused variable ‘ty’ [-Wunused-variable]
   double y, t, del, res, res1, hy, z, zz, p, hx, tx, ty, s;
						      ^
This patch fixes it for sysdeps/ieee754/dbl-64/e_sqrt.c where it happens.

	* sysdeps/ieee754/dbl-64/e_sqrt.c
	  (__ieee754_sqrt): declare p, hx, tx and ty conditionally.

Signed-off-by: Yury Norov <ynorov@caviumnetworks.com>
---
 sysdeps/ieee754/dbl-64/e_sqrt.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/sysdeps/ieee754/dbl-64/e_sqrt.c b/sysdeps/ieee754/dbl-64/e_sqrt.c
index 8304a2b..d234678 100644
--- a/sysdeps/ieee754/dbl-64/e_sqrt.c
+++ b/sysdeps/ieee754/dbl-64/e_sqrt.c
@@ -53,7 +53,11 @@ __ieee754_sqrt (double x)
     rt2 = 3.75017500867345182581453026130850E-01,
     rt3 = 3.12523626554518656309172508769531E-01;
   static const double big = 134217728.0;
-  double y, t, del, res, res1, hy, z, zz, p, hx, tx, ty, s;
+  double y, t, del, res, res1, hy, z, zz, s;
+#ifndef DLA_FMS
+  double p, hx, tx, ty;
+#endif
+
   mynumber a, c = { { 0, 0 } };
   int4 k;
 
-- 
2.7.4


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