diff options
Diffstat (limited to 'meta-openstack/recipes-extended/uwsgi/files/more-Add-explicit-breaks-to-avoid-implicit-passthrough.patch')
-rw-r--r-- | meta-openstack/recipes-extended/uwsgi/files/more-Add-explicit-breaks-to-avoid-implicit-passthrough.patch | 50 |
1 files changed, 50 insertions, 0 deletions
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 @@ | |||
1 | From 54666237455273e147eadb1904d261ed7624a8b6 Mon Sep 17 00:00:00 2001 | ||
2 | From: Paul Tagliamonte <tag@pault.ag> | ||
3 | Date: Mon, 14 Aug 2017 15:42:15 -0400 | ||
4 | Subject: [PATCH] Add explicit breaks to avoid implicit passthrough. | ||
5 | |||
6 | commit 54666237455273e147eadb1904d261ed7624a8b6 from upstream | ||
7 | git://github.com/unbit/uwsgi.git | ||
8 | |||
9 | -Werror=implicit-fallthrough was added in gcc 7.1, which will | ||
10 | throw a compile error if a switch has an implicit passthrough. | ||
11 | |||
12 | Seeing as how this switch doesn't appear to depend on passthrough to | ||
13 | function correctly, I've added explicit breaks to the switch. | ||
14 | |||
15 | From https://gcc.gnu.org/gcc-7/changes.html: | ||
16 | |||
17 | -Wimplicit-fallthrough warns when a switch case falls through. This | ||
18 | warning has five different levels. The compiler is able to parse a wide | ||
19 | range of fallthrough comments, depending on the level. It also handles | ||
20 | control-flow statements, such as ifs. It's possible to suppress the | ||
21 | warning by either adding a fallthrough comment, or by using a null | ||
22 | statement: __attribute__ ((fallthrough)); (C, C++), or [[fallthrough]]; | ||
23 | (C++17), or [[gnu::fallthrough]]; (C++11/C++14). This warning is enabled | ||
24 | by -Wextra. | ||
25 | --- | ||
26 | core/routing.c | 8 ++++---- | ||
27 | 1 file changed, 4 insertions(+), 4 deletions(-) | ||
28 | |||
29 | diff --git a/core/routing.c b/core/routing.c | ||
30 | index 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 | -- | ||
49 | 2.7.4 | ||
50 | |||