aboutsummaryrefslogtreecommitdiffstats
path: root/meta-openstack/recipes-extended/uwsgi/files/Add-explicit-breaks-to-avoid-implicit-passthrough.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta-openstack/recipes-extended/uwsgi/files/Add-explicit-breaks-to-avoid-implicit-passthrough.patch')
-rw-r--r--meta-openstack/recipes-extended/uwsgi/files/Add-explicit-breaks-to-avoid-implicit-passthrough.patch50
1 files changed, 50 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 00000000..4b9c015a
--- /dev/null
+++ b/meta-openstack/recipes-extended/uwsgi/files/Add-explicit-breaks-to-avoid-implicit-passthrough.patch
@@ -0,0 +1,50 @@
+From 0a14d0f0425f00421a69f0ca8e09a92cfdfc6a36 Mon Sep 17 00:00:00 2001
+From: Paul Tagliamonte <paultag@gmail.com>
+Date: Mon, 7 Aug 2017 11:18:56 -0400
+Subject: [PATCH] Add explicit breaks to avoid implicit passthrough.
+
+commit 0a14d0f0425f00421a69f0ca8e09a92cfdfc6a36 from upstream
+git://github.com/unbit/uwsgi.git
+
+-Werror=implicit-fallthrough was added in gcc 7.1, which will
+throw a compile error if a switch has an implicit passthrough.
+
+Seeing as how this switch doesn't appear to depend on passthrough to
+function correctly, I've added explicit breaks to the switch.
+
+From https://gcc.gnu.org/gcc-7/changes.html:
+
+-Wimplicit-fallthrough warns when a switch case falls through. This
+warning has five different levels. The compiler is able to parse a wide
+range of fallthrough comments, depending on the level. It also handles
+control-flow statements, such as ifs. It's possible to suppress the
+warning by either adding a fallthrough comment, or by using a null
+statement: __attribute__ ((fallthrough)); (C, C++), or [[fallthrough]];
+(C++17), or [[gnu::fallthrough]]; (C++11/C++14). This warning is enabled
+by -Wextra.
+---
+ core/hash.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/core/hash.c b/core/hash.c
+index a1288fa..9ae6bd2 100644
+--- a/core/hash.c
++++ b/core/hash.c
+@@ -42,11 +42,14 @@ static uint32_t murmur2_hash(char *key, uint64_t keylen) {
+ switch (keylen) {
+ case 3:
+ h ^= key[2] << 16;
++ break;
+ case 2:
+ h ^= key[1] << 8;
++ break;
+ case 1:
+ h ^= key[0];
+ h *= 0x5bd1e995;
++ break;
+ }
+
+ h ^= h >> 13;
+--
+2.7.4
+