Upgrade to thud
[AGL/meta-agl.git] / meta-security / recipes-security / cynara / cynara / 0001-Add-fallthrough-tags.patch
1 From 8bf90bf3e7a821dbd3b7029d87aa592eec6f1754 Mon Sep 17 00:00:00 2001
2 From: =?UTF-8?q?Jos=C3=A9=20Bollo?= <jose.bollo@iot.bzh>
3 Date: Thu, 25 Jan 2018 12:00:18 +0100
4 Subject: [PATCH] Add fallthrough tags
5 MIME-Version: 1.0
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
8
9 GCC 7 emits a warning when the tag /*@fallthrough@*/
10 doesn't appear in a switch case when a case continue
11 to the next after some processing.
12
13 Change-Id: I420e3788a4c0a6d910a1214964c5480bbd12708c
14 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
15
16 ---
17  src/admin/api/admin-api.cpp         | 1 +
18  src/client-async/logic/Logic.cpp    | 1 +
19  src/common/sockets/SocketClient.cpp | 1 +
20  3 files changed, 3 insertions(+)
21
22 diff --git a/src/admin/api/admin-api.cpp b/src/admin/api/admin-api.cpp
23 index c638f41..aafa45e 100644
24 --- a/src/admin/api/admin-api.cpp
25 +++ b/src/admin/api/admin-api.cpp
26 @@ -146,6 +146,7 @@ int cynara_admin_set_policies(struct cynara_admin *p_cynara_admin,
27                  case CYNARA_ADMIN_BUCKET:
28                      if (!isStringValid(policy->result_extra))
29                          return CYNARA_API_INVALID_PARAM;
30 +                    /*@fallthrough@*/
31                  default:
32                  {
33                      std::string extraStr = policy->result_extra ? policy->result_extra : "";
34 diff --git a/src/client-async/logic/Logic.cpp b/src/client-async/logic/Logic.cpp
35 index 5ae0251..c1d6c33 100644
36 --- a/src/client-async/logic/Logic.cpp
37 +++ b/src/client-async/logic/Logic.cpp
38 @@ -233,6 +233,7 @@ bool Logic::processOut(void) {
39          case Socket::SendStatus::ALL_DATA_SENT:
40              onStatusChange(m_socketClient.getSockFd(),
41                             cynara_async_status::CYNARA_STATUS_FOR_READ);
42 +            /*@fallthrough@*/
43          case Socket::SendStatus::PARTIAL_DATA_SENT:
44              return true;
45          default:
46 diff --git a/src/common/sockets/SocketClient.cpp b/src/common/sockets/SocketClient.cpp
47 index b1ca4f7..f4394e5 100644
48 --- a/src/common/sockets/SocketClient.cpp
49 +++ b/src/common/sockets/SocketClient.cpp
50 @@ -45,6 +45,7 @@ bool SocketClient::connect(void) {
51                  LOGW("Error connecting to Cynara. Service not available.");
52                  return false;
53              }
54 +            /*@fallthrough@*/
55          default:
56              return true;
57      }