summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/glibc/glibc/0031-sysdeps-ieee754-prevent-maybe-uninitialized-errors.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-core/glibc/glibc/0031-sysdeps-ieee754-prevent-maybe-uninitialized-errors.patch')
-rw-r--r--meta/recipes-core/glibc/glibc/0031-sysdeps-ieee754-prevent-maybe-uninitialized-errors.patch95
1 files changed, 95 insertions, 0 deletions
diff --git a/meta/recipes-core/glibc/glibc/0031-sysdeps-ieee754-prevent-maybe-uninitialized-errors.patch b/meta/recipes-core/glibc/glibc/0031-sysdeps-ieee754-prevent-maybe-uninitialized-errors.patch
new file mode 100644
index 0000000000..b02c4ec94f
--- /dev/null
+++ b/meta/recipes-core/glibc/glibc/0031-sysdeps-ieee754-prevent-maybe-uninitialized-errors.patch
@@ -0,0 +1,95 @@
1From c6cc5a6ef46837e341fe271b5ffa6def23810082 Mon Sep 17 00:00:00 2001
2From: Martin Jansa <Martin.Jansa@gmail.com>
3Date: Fri, 14 Sep 2018 23:23:03 +0000
4Subject: [PATCH] sysdeps/ieee754: prevent maybe-uninitialized errors
5
6* with -O included in BUILD_OPTIMIZATION when DEBUG_BUILD
7 is used, nativesdk-glibc fails with:
8../sysdeps/ieee754/ldbl-96/e_jnl.c: In function '__ieee754_jnl':
9../sysdeps/ieee754/ldbl-96/e_jnl.c:146:20: error: 'temp' may be used uninitialized in this function [-Werror=maybe-uninitialized]
10 b = invsqrtpi * temp / sqrtl (x);
11 ~~~~~~~~~~^~~~~~
12../sysdeps/ieee754/ldbl-96/e_jnl.c: In function '__ieee754_ynl':
13../sysdeps/ieee754/ldbl-96/e_jnl.c:375:16: error: 'temp' may be used uninitialized in this function [-Werror=maybe-uninitialized]
14 b = invsqrtpi * temp / sqrtl (x);
15 ~~~~~~~~~~^~~~~~
16
17* work around the issue instead of removing -O like we do with
18 SELECTED_OPTIMIZATION
19
20Upstream-Status: Submitted [https://www.sourceware.org/ml/libc-alpha/2018-09/msg00299.html]
21
22Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
23---
24 sysdeps/ieee754/dbl-64/e_jn.c | 2 ++
25 sysdeps/ieee754/ldbl-128/e_jnl.c | 4 ++++
26 sysdeps/ieee754/ldbl-96/e_jnl.c | 4 ++++
27 3 files changed, 10 insertions(+)
28
29diff --git a/sysdeps/ieee754/dbl-64/e_jn.c b/sysdeps/ieee754/dbl-64/e_jn.c
30index 9181b22bb8..74a6b5f149 100644
31--- a/sysdeps/ieee754/dbl-64/e_jn.c
32+++ b/sysdeps/ieee754/dbl-64/e_jn.c
33@@ -108,6 +108,7 @@ __ieee754_jn (int n, double x)
34 case 1: temp = -c + s; break;
35 case 2: temp = -c - s; break;
36 case 3: temp = c - s; break;
37+ default: temp = 0; // just to prevent error: 'temp' may be used uninitialized in this function [-Werror=maybe-uninitialized]
38 }
39 b = invsqrtpi * temp / sqrt (x);
40 }
41@@ -315,6 +316,7 @@ __ieee754_yn (int n, double x)
42 case 1: temp = -s - c; break;
43 case 2: temp = -s + c; break;
44 case 3: temp = s + c; break;
45+ default: temp = 0; // just to prevent error: 'temp' may be used uninitialized in this function [-Werror=maybe-uninitialized]
46 }
47 b = invsqrtpi * temp / sqrt (x);
48 }
49diff --git a/sysdeps/ieee754/ldbl-128/e_jnl.c b/sysdeps/ieee754/ldbl-128/e_jnl.c
50index 7739eec291..b6a1275464 100644
51--- a/sysdeps/ieee754/ldbl-128/e_jnl.c
52+++ b/sysdeps/ieee754/ldbl-128/e_jnl.c
53@@ -149,6 +149,8 @@ __ieee754_jnl (int n, _Float128 x)
54 case 3:
55 temp = c - s;
56 break;
57+ default:
58+ temp = 0; // just to prevent error: 'temp' may be used uninitialized in this function [-Werror=maybe-uninitialized]
59 }
60 b = invsqrtpi * temp / sqrtl (x);
61 }
62@@ -385,6 +387,8 @@ __ieee754_ynl (int n, _Float128 x)
63 case 3:
64 temp = s + c;
65 break;
66+ default:
67+ temp = 0; // just to prevent error: 'temp' may be used uninitialized in this function [-Werror=maybe-uninitialized]
68 }
69 b = invsqrtpi * temp / sqrtl (x);
70 }
71diff --git a/sysdeps/ieee754/ldbl-96/e_jnl.c b/sysdeps/ieee754/ldbl-96/e_jnl.c
72index 394921f564..2263b02203 100644
73--- a/sysdeps/ieee754/ldbl-96/e_jnl.c
74+++ b/sysdeps/ieee754/ldbl-96/e_jnl.c
75@@ -142,6 +142,8 @@ __ieee754_jnl (int n, long double x)
76 case 3:
77 temp = c - s;
78 break;
79+ default:
80+ temp = 0; // just to prevent error: 'temp' may be used uninitialized in this function [-Werror=maybe-uninitialized]
81 }
82 b = invsqrtpi * temp / sqrtl (x);
83 }
84@@ -371,6 +373,8 @@ __ieee754_ynl (int n, long double x)
85 case 3:
86 temp = s + c;
87 break;
88+ default:
89+ temp = 0; // just to prevent error: 'temp' may be used uninitialized in this function [-Werror=maybe-uninitialized]
90 }
91 b = invsqrtpi * temp / sqrtl (x);
92 }
93--
942.17.1
95