musl - musl - an implementation of the standard library for Linux-based systems

index : musl
musl - an implementation of the standard library for Linux-based systems
summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2024年01月29日 09:05:32 -0500
committerRich Felker <dalias@aerifal.cx>2024年02月03日 19:50:58 -0500
commit0e330722c353e71ec9d1518d77278c09f39a1c55 (patch)
treeb429913d802711a81c7db0af55769148110ac63a /src
parentbd3138b74a06dd764508f399d1b58cb9d6c35c1f (diff)
downloadmusl-0e330722c353e71ec9d1518d77278c09f39a1c55.tar.gz
sqrtl: fix invalid use of a non-constant-expression as static initializer
having these constants be static was unnecessary, so just remove the static. this error should have been caught by compilers, but recent versions of both gcc and clang accept these as "other forms of constant expressions" which the C standard allows.
Diffstat (limited to 'src')
-rw-r--r--src/math/sqrtl.c 4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/math/sqrtl.c b/src/math/sqrtl.c
index 1b9f19c7..a231b3f2 100644
--- a/src/math/sqrtl.c
+++ b/src/math/sqrtl.c
@@ -205,7 +205,7 @@ long double sqrtl(long double x)
top = (top + 0x3fff) >> 1;
/* r ~ 1/sqrt(m) */
- static const uint64_t three = 0xc0000000;
+ const uint64_t three = 0xc0000000;
uint64_t r, s, d, u, i;
i = (ix.hi >> 42) % 128;
r = (uint32_t)__rsqrt_tab[i] << 16;
@@ -227,7 +227,7 @@ long double sqrtl(long double x)
r = mul64(u, r) << 1;
/* |r sqrt(m) - 1| < 0x1.c001p-59, switch to 128bit */
- static const u128 threel = {.hi=three<<32, .lo=0};
+ const u128 threel = {.hi=three<<32, .lo=0};
u128 rl, sl, dl, ul;
rl.hi = r;
rl.lo = 0;
generated by cgit v1.2.1 (git 2.18.0) at 2025年09月20日 12:39:09 +0000

AltStyle によって変換されたページ (->オリジナル) /