summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Asselstine <mark.asselstine@windriver.com>2017-08-23 15:20:48 -0400
committerBruce Ashfield <bruce.ashfield@windriver.com>2017-08-24 09:58:54 -0400
commit0330cdf2c1b4494568de8785ac56ca734616e196 (patch)
tree7eb4d52955689e50da215acc0690b2b3216e6a8c
parent945e7af04b58cede0c4210b61671886b45b005dc (diff)
downloadmeta-cloud-services-0330cdf2c1b4494568de8785ac56ca734616e196.tar.gz
uwsgi: fixups for gcc 7.x
Apply several upstream patches to fixup fallthrough switch statements. This fixes build failures such as: | core/hash.c:44:13: error: this statement may fall through [-Werror=implicit-fallthrough=] | h ^= key[2] << 16; | ~~^~~~~~~~~~~~~~~ | core/hash.c:45:7: note: here | case 2: | ^~~~ Signed-off-by: Mark Asselstine <mark.asselstine@windriver.com> Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
-rw-r--r--meta-openstack/recipes-extended/uwsgi/files/Add-explicit-breaks-to-avoid-implicit-passthrough.patch50
-rw-r--r--meta-openstack/recipes-extended/uwsgi/files/more-Add-explicit-breaks-to-avoid-implicit-passthrough.patch50
-rw-r--r--meta-openstack/recipes-extended/uwsgi/uwsgi_git.bb2
3 files changed, 102 insertions, 0 deletions
diff --git a/meta-openstack/recipes-extended/uwsgi/files/Add-explicit-breaks-to-avoid-implicit-passthrough.patch b/meta-openstack/recipes-extended/uwsgi/files/Add-explicit-breaks-to-avoid-implicit-passthrough.patch
new file mode 100644
index 0000000..4b9c015
--- /dev/null
+++ b/meta-openstack/recipes-extended/uwsgi/files/Add-explicit-breaks-to-avoid-implicit-passthrough.patch
@@ -0,0 +1,50 @@
1From 0a14d0f0425f00421a69f0ca8e09a92cfdfc6a36 Mon Sep 17 00:00:00 2001
2From: Paul Tagliamonte <paultag@gmail.com>
3Date: Mon, 7 Aug 2017 11:18:56 -0400
4Subject: [PATCH] Add explicit breaks to avoid implicit passthrough.
5
6commit 0a14d0f0425f00421a69f0ca8e09a92cfdfc6a36 from upstream
7git://github.com/unbit/uwsgi.git
8
9-Werror=implicit-fallthrough was added in gcc 7.1, which will
10throw a compile error if a switch has an implicit passthrough.
11
12Seeing as how this switch doesn't appear to depend on passthrough to
13function correctly, I've added explicit breaks to the switch.
14
15From https://gcc.gnu.org/gcc-7/changes.html:
16
17-Wimplicit-fallthrough warns when a switch case falls through. This
18warning has five different levels. The compiler is able to parse a wide
19range of fallthrough comments, depending on the level. It also handles
20control-flow statements, such as ifs. It's possible to suppress the
21warning by either adding a fallthrough comment, or by using a null
22statement: __attribute__ ((fallthrough)); (C, C++), or [[fallthrough]];
23(C++17), or [[gnu::fallthrough]]; (C++11/C++14). This warning is enabled
24by -Wextra.
25---
26 core/hash.c | 3 +++
27 1 file changed, 3 insertions(+)
28
29diff --git a/core/hash.c b/core/hash.c
30index a1288fa..9ae6bd2 100644
31--- a/core/hash.c
32+++ b/core/hash.c
33@@ -42,11 +42,14 @@ static uint32_t murmur2_hash(char *key, uint64_t keylen) {
34 switch (keylen) {
35 case 3:
36 h ^= key[2] << 16;
37+ break;
38 case 2:
39 h ^= key[1] << 8;
40+ break;
41 case 1:
42 h ^= key[0];
43 h *= 0x5bd1e995;
44+ break;
45 }
46
47 h ^= h >> 13;
48--
492.7.4
50
diff --git a/meta-openstack/recipes-extended/uwsgi/files/more-Add-explicit-breaks-to-avoid-implicit-passthrough.patch b/meta-openstack/recipes-extended/uwsgi/files/more-Add-explicit-breaks-to-avoid-implicit-passthrough.patch
new file mode 100644
index 0000000..5a885ed
--- /dev/null
+++ b/meta-openstack/recipes-extended/uwsgi/files/more-Add-explicit-breaks-to-avoid-implicit-passthrough.patch
@@ -0,0 +1,50 @@
1From 54666237455273e147eadb1904d261ed7624a8b6 Mon Sep 17 00:00:00 2001
2From: Paul Tagliamonte <tag@pault.ag>
3Date: Mon, 14 Aug 2017 15:42:15 -0400
4Subject: [PATCH] Add explicit breaks to avoid implicit passthrough.
5
6commit 54666237455273e147eadb1904d261ed7624a8b6 from upstream
7git://github.com/unbit/uwsgi.git
8
9-Werror=implicit-fallthrough was added in gcc 7.1, which will
10throw a compile error if a switch has an implicit passthrough.
11
12Seeing as how this switch doesn't appear to depend on passthrough to
13function correctly, I've added explicit breaks to the switch.
14
15From https://gcc.gnu.org/gcc-7/changes.html:
16
17-Wimplicit-fallthrough warns when a switch case falls through. This
18warning has five different levels. The compiler is able to parse a wide
19range of fallthrough comments, depending on the level. It also handles
20control-flow statements, such as ifs. It's possible to suppress the
21warning by either adding a fallthrough comment, or by using a null
22statement: __attribute__ ((fallthrough)); (C, C++), or [[fallthrough]];
23(C++17), or [[gnu::fallthrough]]; (C++11/C++14). This warning is enabled
24by -Wextra.
25---
26 core/routing.c | 8 ++++----
27 1 file changed, 4 insertions(+), 4 deletions(-)
28
29diff --git a/core/routing.c b/core/routing.c
30index 5887ec3..0cd6ea6 100644
31--- a/core/routing.c
32+++ b/core/routing.c
33@@ -1792,10 +1792,10 @@ static int uwsgi_route_condition_ipv6in(struct wsgi_request *wsgi_req, struct uw
34
35 int i = (pfxlen / 32);
36 switch (i) {
37- case 0: mask[0] = 0;
38- case 1: mask[1] = 0;
39- case 2: mask[2] = 0;
40- case 3: mask[3] = 0;
41+ case 0: mask[0] = 0; break;
42+ case 1: mask[1] = 0; break;
43+ case 2: mask[2] = 0; break;
44+ case 3: mask[3] = 0; break;
45 }
46
47 if (pfxlen % 32)
48--
492.7.4
50
diff --git a/meta-openstack/recipes-extended/uwsgi/uwsgi_git.bb b/meta-openstack/recipes-extended/uwsgi/uwsgi_git.bb
index dae288a..f0c535f 100644
--- a/meta-openstack/recipes-extended/uwsgi/uwsgi_git.bb
+++ b/meta-openstack/recipes-extended/uwsgi/uwsgi_git.bb
@@ -6,6 +6,8 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=33ab1ce13e2312dddfad07f97f66321f"
6 6
7SRCNAME = "uwsgi" 7SRCNAME = "uwsgi"
8SRC_URI = "git://github.com/unbit/uwsgi.git;branch=uwsgi-2.0 \ 8SRC_URI = "git://github.com/unbit/uwsgi.git;branch=uwsgi-2.0 \
9 file://Add-explicit-breaks-to-avoid-implicit-passthrough.patch \
10 file://more-Add-explicit-breaks-to-avoid-implicit-passthrough.patch \
9" 11"
10 12
11SRCREV="af44211739136e22471a2897383f34586284bf86" 13SRCREV="af44211739136e22471a2897383f34586284bf86"