11387b98b919b62ac248232e43673bfa804433ad
[AGL/meta-agl.git] / meta-security / recipes-security / cynara / cynara / 0001-Add-fallthrough-tags.patch
1 From 3d387993b5a4283e8aebd8e777b2ccd45d233959 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 1/6] 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  src/admin/api/admin-api.cpp         | 1 +
17  src/client-async/logic/Logic.cpp    | 1 +
18  src/common/sockets/SocketClient.cpp | 1 +
19  3 files changed, 3 insertions(+)
20
21 diff --git a/src/admin/api/admin-api.cpp b/src/admin/api/admin-api.cpp
22 index c638f41..aafa45e 100644
23 --- a/src/admin/api/admin-api.cpp
24 +++ b/src/admin/api/admin-api.cpp
25 @@ -146,6 +146,7 @@ int cynara_admin_set_policies(struct cynara_admin *p_cynara_admin,
26                  case CYNARA_ADMIN_BUCKET:
27                      if (!isStringValid(policy->result_extra))
28                          return CYNARA_API_INVALID_PARAM;
29 +                    /*@fallthrough@*/
30                  default:
31                  {
32                      std::string extraStr = policy->result_extra ? policy->result_extra : "";
33 diff --git a/src/client-async/logic/Logic.cpp b/src/client-async/logic/Logic.cpp
34 index 5ae0251..c1d6c33 100644
35 --- a/src/client-async/logic/Logic.cpp
36 +++ b/src/client-async/logic/Logic.cpp
37 @@ -233,6 +233,7 @@ bool Logic::processOut(void) {
38          case Socket::SendStatus::ALL_DATA_SENT:
39              onStatusChange(m_socketClient.getSockFd(),
40                             cynara_async_status::CYNARA_STATUS_FOR_READ);
41 +            /*@fallthrough@*/
42          case Socket::SendStatus::PARTIAL_DATA_SENT:
43              return true;
44          default:
45 diff --git a/src/common/sockets/SocketClient.cpp b/src/common/sockets/SocketClient.cpp
46 index b1ca4f7..f4394e5 100644
47 --- a/src/common/sockets/SocketClient.cpp
48 +++ b/src/common/sockets/SocketClient.cpp
49 @@ -45,6 +45,7 @@ bool SocketClient::connect(void) {
50                  LOGW("Error connecting to Cynara. Service not available.");
51                  return false;
52              }
53 +            /*@fallthrough@*/
54          default:
55              return true;
56      }
57 -- 
58 2.14.3
59