Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2018-08-08 11:41:58 +0300
committerCorinna Vinschen <corinna@vinschen.de>2018-08-08 11:50:19 +0300
commit2d87d95f12bbbb8bff611c8a19b943b9ebedb1fd (patch)
treef59aa2e3271c3cf7baa629e1cedc567ef46526de /newlib/libm
parent5ace9004d9b982ba8887df41139295792c130020 (diff)
newlib: fix various gcc warnings
* unused variables * potentially used uninitialized * suggested bracketing * misleading indentation Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Diffstat (limited to 'newlib/libm')
-rw-r--r--newlib/libm/common/math_config.h2
-rw-r--r--newlib/libm/common/sqrtl.c2
-rw-r--r--newlib/libm/math/ef_jn.c1
-rw-r--r--newlib/libm/math/k_rem_pio2.c3
-rw-r--r--newlib/libm/math/kf_rem_pio2.c3
5 files changed, 7 insertions, 4 deletions
diff --git a/newlib/libm/common/math_config.h b/newlib/libm/common/math_config.h
index d5896bbdd..cca682ed7 100644
--- a/newlib/libm/common/math_config.h
+++ b/newlib/libm/common/math_config.h
@@ -205,6 +205,7 @@ opt_barrier_double (double x)
volatile double y = x;
return y;
}
+#pragma GCC diagnostic ignored "-Wunused-variable"
static inline void
force_eval_float (float x)
{
@@ -215,6 +216,7 @@ force_eval_double (double x)
{
volatile double y = x;
}
+#pragma GCC diagnostic pop
#endif
/* Evaluate an expression as the specified type, normally a type
diff --git a/newlib/libm/common/sqrtl.c b/newlib/libm/common/sqrtl.c
index 8cd717e19..9976f35e7 100644
--- a/newlib/libm/common/sqrtl.c
+++ b/newlib/libm/common/sqrtl.c
@@ -123,7 +123,7 @@ long double
sqrtl (long double x)
{
union ieee_ext_u ux = { .extu_ld = x, };
- int k, r;
+ int k;
long double lo, xn;
/* If x = NaN, then sqrt(x) = NaN. */
diff --git a/newlib/libm/math/ef_jn.c b/newlib/libm/math/ef_jn.c
index bedfb3ed5..e872c09c7 100644
--- a/newlib/libm/math/ef_jn.c
+++ b/newlib/libm/math/ef_jn.c
@@ -20,7 +20,6 @@ static const float
#else
static float
#endif
-invsqrtpi= 5.6418961287e-01, /* 0x3f106ebb */
two = 2.0000000000e+00, /* 0x40000000 */
one = 1.0000000000e+00; /* 0x3F800000 */
diff --git a/newlib/libm/math/k_rem_pio2.c b/newlib/libm/math/k_rem_pio2.c
index 856925668..46201874c 100644
--- a/newlib/libm/math/k_rem_pio2.c
+++ b/newlib/libm/math/k_rem_pio2.c
@@ -187,7 +187,8 @@ twon24 = 5.96046447753906250000e-08; /* 0x3E700000, 0x00000000 */
/* compute q[0],q[1],...q[jk] */
for (i=0;i<=jk;i++) {
- for(j=0,fw=0.0;j<=jx;j++) fw += x[j]*f[jx+i-j]; q[i] = fw;
+ for(j=0,fw=0.0;j<=jx;j++) fw += x[j]*f[jx+i-j];
+ q[i] = fw;
}
jz = jk;
diff --git a/newlib/libm/math/kf_rem_pio2.c b/newlib/libm/math/kf_rem_pio2.c
index 261c48129..1573ca9f6 100644
--- a/newlib/libm/math/kf_rem_pio2.c
+++ b/newlib/libm/math/kf_rem_pio2.c
@@ -77,7 +77,8 @@ twon8 = 3.9062500000e-03; /* 0x3b800000 */
/* compute q[0],q[1],...q[jk] */
for (i=0;i<=jk;i++) {
- for(j=0,fw=0.0;j<=jx;j++) fw += x[j]*f[jx+i-j]; q[i] = fw;
+ for(j=0,fw=0.0;j<=jx;j++) fw += x[j]*f[jx+i-j];
+ q[i] = fw;
}
jz = jk;